I have been using this code to activate MDI child forms:
VB Code:
Public Sub ShowSingleInstance(ByVal childType As Type) For Each child As Form In Me.MdiChildren If child.GetType Is childType Then child.Activate() 'already loaded so bring to foreground Return End If Next Dim frm As New Form frm = Activator.CreateInstance(childType) 'not loaded yet so create frm.MdiParent = Me frm.Show() End Sub
If the MDI child is either not loaded or is behind another MDI child, its Form_Activated event will fire. However, if the MDI child is already the uppermost form, the Form_Activated event does not fire even if I explicitly call frm.Activate at the end of the above code.
How do I make the Form_Activated event fire regardless of the MDI child form's current state?




Reply With Quote