I want to embed a Form
within another Form
. Here is what I have tried:
private void Form1_Load(object sender, EventArgs e)
{
Form2 form = new Form2();
form.TopLevel = false;
panel1.Controls.Add(form);
form.Dock = DockStyle.Fill;
form.Show();
}
Form1
is the parent form. Form2
is the child form, which has a TextBox
control.
The problem: After embedding the child form, the TextBox
in the child form cannot be selected with the mouse.
Can anyone help?