How to open a form within a form?

Following is the code to do what you want:

Assume that button1 is in the parent form.

private void button1_Click(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;
            Form Form2 = new Form();
            Form2.MdiParent = this;
            Form2.Show();
        }

Also the following link will provide you more better details of what you want to do:

http://www.codeproject.com/KB/cs/mdiformstutorial.aspx

Hope this helps…

Leave a Comment