my form i need to disable to function to close the application, anyone knows how do i make it do nothing or disable the close button of the form?
Printable View
my form i need to disable to function to close the application, anyone knows how do i make it do nothing or disable the close button of the form?
You can remote the 'Control Box' (Minimize, Resize and Close) with
Me.ControlBox = False
You can also check with the user to ensure they really want to close your application with something like the following
VB Code:
Private Sub FormClosing(ByVal sender AS object, _ ByVal e as System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If MessageBox.Show("Are you sure you wish to close") = DialogResult.Yes Then If MessageBox.Show("Are you really sure :P ") = DialogResult.Yes Then Me.Close() End IF End If End Sub