CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Form close

  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Form close

    I want to hide my form when the user press the close icon in the right top corner of the form ?
    I don't want to unload the form! is there any way to do it?


  2. #2
    Join Date
    Nov 1999
    Location
    France
    Posts
    29

    Re: Form close

    You can, on the unload event, put the 'cancel' variable to 1 and do me.hide:

    private sub Form1_unload (cancel as integer)
    if not close then
    'close is your regular way to close the form (I hope there is one : button click,etc...)
    cancel=1
    me.hide
    end if
    end sub





  3. #3
    Join Date
    Nov 1999
    Posts
    2

    Re: Form close

    I only know one way to do this (but I'm a beginner also!).
    example:

    Private Sub Form_Load()

    STARTPAGE.Visible = False
    2NDPAGE.Visible = True


    This is a very easy way to do it and I don't know if there's another (better) way. This action will first call for the start page, hide it without the knowledge of the user and shows the second page. If you now close the second page the first page will still remain in the memory.

    have fun.

    Zion


  4. #4
    Join Date
    Nov 1999
    Posts
    7

    Re: Form close

    here you can do ..

    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    'Cancel = True
    Me.Hide
    End Sub



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured