Form in Form on panel/frame

G

Guest

Anyone know if it's possible to 'project' a (child) form onto a panel/frame
of an existing form? (and how to do it?)

i.e:
Form_A has a panel_A
Form_B (with it's content) has to be shown on panel_A (which is on Form_A),
not using MDI-style

Thanks in advanced!
 
S

Stephany Young

Rubbish!!!!!!!!!!!!

Form_B _frm = new Form_B();
_frm.Parent = panel_A;
_frm.Show();

Be careful though. You will find that there is quaite an overhead involved.
 
P

PS

Stephany Young said:
Rubbish!!!!!!!!!!!!

Form_B _frm = new Form_B();
_frm.Parent = panel_A;
_frm.Show();

Rubbish?? Try it yourself.

An unhandled exception of type 'System.ArgumentException' occurred in
System.Windows.Forms.dll
Additional information: Top-level control cannot be added to a control.

PS
 
S

Stephany Young

Oh what a silly little mistake:

Form_B _frm = new Form_B();
_frm.TopLevel = false;
_frm.Parent = panel_A;
_frm.Show();
 

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