Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

AddHandler not working in child form

$
0
0

I have an MdiForm application. I have 2 child forms inside the MdiMain form.

I have a button on ChildForm1 that when clicked opens ChildForm2. On the button click event I have:

Dim vLU As New ChildForm2
        vLU.MdiParent = Me.MdiParent
        AddHandler ChildForm2.FormClosed, AddressOf GiveFocusToLocation
        vLU.Show()

The "GiveFocusToLocation" method is on the ChildForm1

When I click on the button on ChildForm1 it opens ChildForm2. BUT when I close ChildForm2, "GiveFocusToLocation" on ChildForm1 is never hit.

What am I doing wrong?
Thank you


Viewing all articles
Browse latest Browse all 12583

Trending Articles