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();
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.
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.