|
-
Nov 28th, 2002, 12:14 AM
#1
Thread Starter
Junior Member
form unload
I put this code to the Closed() event of a Form in VB.NET.
If MessageBox.Show("Would you like to exit?", "Exit", MessageBoxButtons.OKCancel) = DialogResult.OK Then
Application.Exit()
Else
Cancel = 1
End If
All I want to happen is, when I click the Close Button(X) of the Form, the messagebox OK/Cancel will show and asking if you want to exit or not. If you click OK button, the form will unload. But if you click the Cancel button the Form will not unload. I tried the Cancel = 1 but it doesn’t work. Any solution for this problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|