hello,
does any one know which windowsform procedure i need to overrirde to control application exiting? for example, to show an "are u sure u want to exit" dialog.
Printable View
hello,
does any one know which windowsform procedure i need to overrirde to control application exiting? for example, to show an "are u sure u want to exit" dialog.
:)VB Code:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If MessageBox.Show("do you want to save your changes before quiting", Me.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then e.Cancel = True Else e.Cancel = False End If End Sub
VB Code:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing e.Cancel = True ' use this in if block 'to cancel exiting your app End Sub
works like a charm.. thanks, and welcome back pirate