Preventing MDI to close if childforms exists

  • Thread starter Thread starter Jose Fernandez
  • Start date Start date
J

Jose Fernandez

hello
i been trying to get this done but so far... unsuccesful. What can i do to
prevent the user close my Main MDI form by pressing Alt+F4, or clicking on
the Close button of the form?

thanks in advance
 
I found this code using Google - not Microsoft.

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

e.Cancel = Not m_OkToClose
If e.Cancel Then MessageBox.Show("Unload ignored")

End Sub

You can adjust this code to get the required result

Thank _od for Google. U too can use Google

Get with it

Garry
 
Back
Top