Inner forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have main form like Windows Explorer. But in the right part I want to have
another form. How could I do it? How could I insert form into main form.

Jan
 
Jan said:
I have main form like Windows Explorer. But in the right part I want to
have
another form. How could I do it? How could I insert form into main form.

If the form should have a titlebar and the user should be able to move it,
you may want to set the main form's 'IsMdiContainer' property to 'True' and
add subforms as MDI children:

\\\
Dim f As New Form1()
f.MdiParent = Me
f.Show()
///

If the form should be part of the main form, which means that the user
should not be able to move it and recognize it as a separate form, use a
usercontrol instead of a subform.
 
No, I don't want title bar in inner form.
If it was possible I would insert only controls into right part, but I want
to change dynamically all controls in right part.
I have some forms which change in right part of main window.
I think, that the best way is having some forms and change it in right part.
I don't know :(


Jan
 
Jan said:
If it was possible I would insert only controls into right part, but I
want
to change dynamically all controls in right part.
I have some forms which change in right part of main window.
I think, that the best way is having some forms and change it in right
part.

I suggest to design usercontrols instead of forms. These usercontrols can
be added to the form. Depending on the selection one of the usercontrols is
made visible.
 
You can use forms however. In the main form, place a panel to hold the
other form. Then, you can create an instance of the other form and
show it inside the panel:

Dim frm As New SecondForm

frm.TopLevel = False 'This is important
frm.Parent = Panel1 'this is the panel on the main form
frm.show 'The form show now be inside the
panel

As Herfried said, a UserControl might be more appropriate, but this
works as well. Be sure to create the form with no caption.
 
Chris,

Chris Dunaway said:
frm.TopLevel = False 'This is important
frm.Parent = Panel1 'this is the panel on the main form
frm.show 'The form show now be inside the
panel

As Herfried said, a UserControl might be more appropriate, but this
works as well. Be sure to create the form with no caption.

Notice that the solution above may cause tab order problems...
 
Back
Top