I tried to create a new form inside the Parent. I set FormBorderStyle
to none
.
When I am adjusting MDIParent to the myForm
, it gave me a sick looking error like this:
System.ArgumentException : The given Form is not being recalled as a MdiContainer.
This is my code for creating a new Windows Form.
FrmHome myForm = new FrmHome ();
myForm.TopLevel = false;
pnlContainer.Controls.Add(myForm);
myForm.Show();
The Mdi parent must have it's
IsMdiContainer
property set toTrue
.You can set this property at design time in your main form or runtime :-
Form1
is the name of the form that you want to show.Form.IsMdiContainer Property