MDIParent Problem VB.NET

  • Thread starter Thread starter Ron Pagliuca
  • Start date Start date
R

Ron Pagliuca

This code is supposed to pop-up a child window (frmConnector):

Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem5.Click

Dim p_frmConnector As New frmConnector()
p_frmConnector.MdiParent = Me
p_frmConnector.Show()

End Sub


-------- BUT ------

When I click the menu item above no form appears. It will appear if I
take p_frmConnector.MdiParent = Me out of the code. This code sits in
the parent form, I also have Me.IsMdiContainer = True in the form load
of the parent.

I have played around with activate, visible etc...

Please give me some direction as to why this is occuring and even how
to rectify it,

Thanks,

Ron Pagliuca
 
* (e-mail address removed) (Ron Pagliuca) scripsit:
Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem5.Click

Dim p_frmConnector As New frmConnector()
p_frmConnector.MdiParent = Me
p_frmConnector.Show()

End Sub


-------- BUT ------

When I click the menu item above no form appears. It will appear if I
take p_frmConnector.MdiParent = Me out of the code. This code sits in
the parent form, I also have Me.IsMdiContainer = True in the form load
of the parent.

The code should work. Did you try this in a blank project with an MDI
container? Does it work there?
 
Make sure you're actually handling the correct menu item click. Put a breakpoint
on p_frmConnector.Show() and make sure it's being hit. You've probably already
done that, so also try Dim p_frmConnector As New Form(). If you can get just a
vanilla Form to show up, then you know it's your own class that's causing a
problem. If you still have a problem then you should post a simplified repro
here so we can take a look.

HTH,
Bob
 
Back
Top