Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    173

    Unanswered: Hide a Form when Closed using Control Box

    I have a form that loads slow. When I open mymain menu, Iam opening this form in hidden mode. Then I use buttons on the menu to show the form.

    On the form is a close button, that is set to me.visible - false

    this hides the form without closing it.

    The issue I have is this - the user wants a control box on the form to minimize and maximizeit as desired. There is also an X on the control box to close the form.

    Can I set this control box to hide the form instead of closing it?


    Thanks - AB

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    AB,

    It would be easier with a command box on the form. In its OnClick event, a one-liner will do:

    Code:
    Me.Visible = False
    Sam

  3. #3
    Join Date
    Aug 2004
    Posts
    173

    I agree.... But....

    Quote Originally Posted by Sam Landy
    AB,

    It would be easier with a command box on the form. In its OnClick event, a one-liner will do:

    Code:
    Me.Visible = False
    Sam

    I agree - and I do have a command button doing just that - but my customer wants to have the close button on the control box as well. The issue is that the default close button actually closes the form, and when it is reloaded again, it takes 7-10 seconds to load. I would like to use the command button, as well as the default close button to run the me.visible = false code -if possible????

    Thanks - AB

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    In the form's Unload event, set Cancel = True and then Me.Visible = False.

    Careful though - once you open the form with this, it's a bit tricky to actually close it!

    have fun,
    tc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •