Open Form in a Form

  • Thread starter Carlos J. Quintero [.NET MVP]
  • Start date
C

Carlos J. Quintero [.NET MVP]

Couldn´t you use a Usercontrol to be hosted in a form or in a panel?

--
Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
N

Nassos

Hi All,
i was wondering , how is posible to open a Form inside a Panel (for example)
not through MDI property, is a container the right tool for this? How am
MDIParent form is doing it?
thx in advance
 
M

Mick Doherty

Nassos said:
Hi All,
i was wondering , how is posible to open a Form inside a Panel (for
example) not through MDI property, is a container the right tool for this?
How am MDIParent form is doing it?
thx in advance

An MDI parent has an MDIClient control to host forms. Why do you not want an
MDI Form? You can dock other panels in an MDI Form so as to restrict the
MDIClient bounds. See the example on my site:
http://dotnetrix.co.uk/mdi.html

Other than that you should set the forms TopLevel property to False and add
it as a Control, but it will always show as unfocused.
 
C

Chris Dunaway

If you must use a form, just set its TopLevel property to False and set
its parent to the panel and then show it. It will appear inside the
panel (but without a caption bar though).
 
N

Nassos

I want to thank you all for your replies, most appriciated, the TopLevel
property is the think i was looking thanx :)
 
H

Herfried K. Wagner [MVP]

Chris,

Chris Dunaway said:
If you must use a form, just set its TopLevel property to False and set
its parent to the panel and then show it. It will appear inside the
panel (but without a caption bar though).

The embedded form actually will have a caption bar.
 
C

Chris Dunaway

I stand corrected. I recall now, having to turn off the caption. It
is often suggested to use a UserControl instead of a form for this type
of thing. Are user controls any more light weight than a form?
 

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