Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Jul 31, 1998



Application Security Testing: An Integral Part of DevOps

Close Forms Uniformly

To close forms uniformly, treat the system menu's Close command and your File menu's Exit command in the same manner. In your Exit command, simply unload the form. Let the form's QueryUnload event handler see if it is safe to exit. If not, cancel the Exit by setting Cancel to True:

 Private Sub mnuFileExit_Click()
	Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel _
	As Integer, UnloadMode As Integer)
	Cancel = (MsgBox("Are you sure you " & _
		"want to exit?", vbYesNo) = vbNo)
End Sub
Rod Stephens
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date