Using MDI and Child Forms
Code.
childform_load
Me.MdiParent = MDIMain
‘
Private Sub form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Escape Then
Me.Close()
End If
End Sub
The above code is working for MDI Form (form name is mdiform1), but not working for child form1, when I press the escape key, it is closing the MDI Form instead of Child form.
I check the Child Form Name also, name is form1 only.
What was the problem, i need to change any property of child form.
Need code help
This works for me