Closing event in vb.net

Closing event in vb.net


VB .NET includes a new Closing event for a form. In this event, you can trap — and abort — the user’s attempt to close the form (by clicking the x in the top right or by pressing Alt+F4). Here’s an example that traps and aborts closing:
====================================================================
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Dim n As Integer
n = MsgBox("Are you sure you want to close this form?", MsgBoxStyle.YesNo)

If n = MsgBoxResult.No Then
e.Cancel = True
MsgBox("This form will remain open.")
End If
End Sub
====================================================================

1 comment:

Anonymous said...

Casino Game tyuueooru
Online Casinos
This is why online casino seems to be a common interest of many nowadays.
[url=http://www.nhgaa.org/]Online Casinos[/url]
Once you come across the lists, check out each website one after another in order to figure out the one you're actually looking for.
http://www.nhgaa.org/ - Top Casino
So, it is vital to be able to find a right online casino website for you if you don't want your online gambling experience to be annoying and regretting.