I wrote this code to mimic a "Shown" event within a UserControl as I need to start threads after the UI has been created.
I was so sure the code would work but it doesn't fire the threads even after the UI has been created. Could anyone explain why? Or maybe I'm just going about it incorrectly.
I have also checked child forms know what their parent is and that seems to be fine.
Regards, The Dev.
Code:
Private WithEvents pf As Form
Code:
Protected Overrides Sub OnParentChanged(e As EventArgs)
pf = Me.ParentForm
MyBase.OnParentChanged(e)
End Sub
Code:
Private pf_shown(sender As Object, e As EventArgs) Handles pf.Shown
'//Run threads
End Sub
I have also checked child forms know what their parent is and that seems to be fine.
Regards, The Dev.