Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add an SDI child form to a main Modal Form?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,
I create a modal form frmMain (the name is telling, isn't it? ;-) ).
Then I added another, existing (SDI) form (which I'm gonna call from the bar menu on that MDI form)...
... and this is where I ran into a stump: I do not see IsMdiChild property in its properties sheet, only IsMdiContainer!

What am I missing?

AHWBGA!

Regards,

Ilya
 
OK, then - how to add a child SDI form to a parent MDI one?
(That was the original question, BTW.)

Regards,

Ilya
 
Assuming your MDI parent is called something like [tt]myMDIContainer[/tt] and the child is called [tt]myMDIChild[/tt], then something like the following in the container's load event:

Code:
[blue]Private Sub myMDIContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    If Me.IsMdiContainer Then
        myMDIChild.MdiParent = Me
        myMDIChild.Show()
    End If
End Sub[/blue]

Subsequent to this, [tt]myMDIChild.IsMDIChild[/tt] should return True
 
T's working!
[thanks2]
Issue's been resolved, case is closed.

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top