Prevent a form from closing

You can prevent a form from closing by setting event parameter "cancel" to true in "closing" the event of the form.

This tip was submitted to the VS.NET Info Center by member Thomson Alexander.

Please let other users know how useful it is by rating it below. Do you have a tip or code of your own you'd like to share? Submit it here.


You can prevent a form from closing by setting event parameter "cancel" to true in "closing" the event of the form.

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) e Handles MyBase.Closing

e.Cancel = True

End Sub

This was first published in April 2003

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close