0

I need Some help in this case. I have 3 Form (Main Form , Form1 , Form 2) Main Form That is The Parent Form (ISCONTAINER = true) Form 1 Is child for Main Form And In the same time Parent for Form2 Form 2 Is child for Form 1.

This pic that I need to be

1

Please I need code in vb.net

In MainForm I Write this code:

Me.IsMdiContainer = True With Form1 .MdiParent = Me .Show() End With

In Form 2 I write this code:

With Form2 .MdiParent = CType(Me.Parent.Parent, MainForm) .Show() End With

The Form 1 opened as child for MainForm but Form2 doesn't

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • 1
    It CANNOT work that way. You can only have one MdiParent container. A form that is an MdiChild cannot also be an MdiParent at the same time. It is possible to do this WITHOUT using the MDI model, though. You can set `.TopLevel` for the "child forms" to False, then simply add them to any valid container via CODE like any other control. – Idle_Mind Feb 02 '23 at 19:39
  • https://stackoverflow.com/a/4485395/17034 – Hans Passant Feb 02 '23 at 21:34

0 Answers0