T
Tiago M.
Hi!
I have a form inside a panel using:
public void CreateNewFormInsidePanel(){
Form form1 = new Form();
form1.TopLevel = false;
panel.Controls.Add(form1);
form1.Show();
form1.BringToFront();
}
Everything goes according plan when I'm creating a new form after a
button click event but when I want to create a new form inside a panel
just after initializing the main form it does not work.
public Main2()
{
InitializeComponent();
CreateNewFormInsidePanel();
}
The form appears inside the panel but without any label, combobox etc
initialized.
If I do a form1.show after the initialization the content of the form1
appears but of course not inside the panel.
Any help?
I have a form inside a panel using:
public void CreateNewFormInsidePanel(){
Form form1 = new Form();
form1.TopLevel = false;
panel.Controls.Add(form1);
form1.Show();
form1.BringToFront();
}
Everything goes according plan when I'm creating a new form after a
button click event but when I want to create a new form inside a panel
just after initializing the main form it does not work.
public Main2()
{
InitializeComponent();
CreateNewFormInsidePanel();
}
The form appears inside the panel but without any label, combobox etc
initialized.
If I do a form1.show after the initialization the content of the form1
appears but of course not inside the panel.
Any help?