Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form that was specified to be the MdiParent for this form is not an MdiContainer

I was working on an inventory software and suddenly came to know that I need some main form through which I should open all the other forms, so I created one named frmMainPanel and use a menu strip to link it to another I am successful in linking them but they are opening outside the main form, I use following code to link them

Linking frmSaleInvoice form using:

frmSaleInvoice childForm = new frmSaleInvoice();
cs.show()

now i realize i should make them child to the main form so i tried that using following code:

frmSaleInvoice childForm = new frmSaleInvoice();

childForm.MdiParent = this;
childForm.Show();

but it says **" Form that was specified to be the MdiParent for this form is not an MdiContainer."**

can any one help me out wher i am mistaking and how could i make a form named frmSaleInvoice to child of other form named frmMainPanel

like image 502
Jack Frost Avatar asked Mar 24 '14 19:03

Jack Frost


1 Answers

The Mdi parent must have it's IsMdiContainer property set to True. You can set this property at design time in your frmMainPanel form.

like image 171
Crono Avatar answered Oct 13 '22 18:10

Crono