Results 1 to 2 of 2

Thread: form unload

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    form unload

    hi
    i have got a form which if tried to close should get a message wid a yes no. if it is a no then the method should exit
    i implemented Form_Unload as well as Form_QueryUnload, but as i exit the method the form gets closed ne way, wat do i do

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629

    Re: form unload

    VB Code:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.    
    3.     Dim res As Integer
    4.    
    5.     res = MsgBox("Are you sure you want to close this app ?", vbYesNo + vbQuestion, "Application shutdown")
    6.     If res = vbNo Then Cancel = True
    7.    
    8. End Sub
    -= a peet post =-

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