Mdi question

B

BMax

Hello
I created a form that is Mdi container another for child and a dialog form
which is suppose to open that child inside the container.
so i have :
1- main form (Mdi Container)
2- child form (Mdi child)
3- Dialg form (something like a menu to open the childes inside main form)

lets say dialog form has a button click event, how can i set the MdiParent
of child form without creating a new instance of parent form.
thanks in advance,
 
H

Herfried K. Wagner [MVP]

* "BMax said:
I created a form that is Mdi container another for child and a dialog form
which is suppose to open that child inside the container.
so i have :
1- main form (Mdi Container)
2- child form (Mdi child)
3- Dialg form (something like a menu to open the childes inside main form)

lets say dialog form has a button click event, how can i set the MdiParent
of child form without creating a new instance of parent form.

Pass a reference to the MDI main form to your dialog, for example in a
property.
 
H

Herfried K. Wagner [MVP]

* "BMax said:
could you please show an example. some code.

In your dialog:

\\\
Public Class FooForm
Inherits...

Private m_TheMdiContainer As MainForm

Public Property TheMdiContainer() As MainForm
Get
Return m_TheMdiContainer
End Get
Set(ByVal Value As MainForm)
m_TheMdiContainer = Value
End Set
End Property
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top