Form in a Control drawing

Form in a Control drawing

Post by Falk Winkl » Tue, 29 Mar 2005 15:47:22


how i can drawing a Windows Form in a Panel, not on the Dektop.
I will using a Form as Desktop.
 
 
 

Form in a Control drawing

Post by Tim Wilso » Tue, 29 Mar 2005 23:52:29

If you're asking how to display a Form as a child of a Panel, then set the
Form's "TopLevel" property to False, then add it to the controls collection
of the Panel, and then call Show() on it.

Form2 f = new Form2();
f.TopLevel = false;
this.panel1.Controls.Add(f);
f.Show();

--
Tim Wilson
.Net Compact Framework MVP

 
 
 

Form in a Control drawing

Post by Falk Winkl » Wed, 30 Mar 2005 00:52:05

thanks you,

who runs,
as can I thank form in the panel scalieren, e.g. the panel am a Desktop
with a size of 1024x768


"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> schrieb im

collection
 
 
 

Form in a Control drawing

Post by Tim Wilso » Wed, 30 Mar 2005 01:17:19

I'm not sure that I understand what you're asking here... If you're just
trying to host a Form instance in a Panel, then the code that I posted
should work. But the Panel will need to be inside another Form.
Alternatively, you could visually design a UserControl, to be the same as
the Form contents, and then embed an instance of this UserControl in the
Panel instead of the Form.

--
Tim Wilson
.Net Compact Framework MVP




the