Results 1 to 6 of 6

Thread: [RESOLVED] enable the close

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Resolved [RESOLVED] enable the close

    Hi
    I have a form in which there is an "EXIT" command. I want that if the user hits the Close button of the form to execute the sub cmdexit_click

    How can I do it?
    thanks

  2. #2
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: enable the close

    use something within the
    VB Code:
    1. Private Sub Form_Terminate()
    2.  
    3. End Sub

    i think thats how you do it, its a while since ive used that
    If a post has been usefull then Rate it!

  3. #3
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: enable the close

    Code:
    Private Sub form_Unload()
       Call cmdexit_click()
    End Sub


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: enable the close

    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    cmdExit.Value = True
    End Sub

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: enable the close

    thanks for you

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: enable the close

    You are welcome.

    If you consider your question to be answered, please do not forget to mark the thread as resolved.

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