Emergence test of those things --C # anomalies can not be added to the top-level control Controls

In use Visual Studio 2005 to develop Windows programs when the need is displayed in a container control in a new Form, use the following code directly abnormalities can not add a top-level control to control:
MyForm = myForm new new MyForm ();
container.Controls.Add ( myForm);
online access to relevant information, the solution is simple. Since Form default top-level control, so join in a container control will appear in the title shown abnormal.
Before adding the code as long as the control is set to Form a non-top-level control can solve the error.
= New new myForm the MyForm the MyForm ();
myForm.TopLevel = to false;
container.Controls.Add (myForm);

Guess you like

Origin www.cnblogs.com/mgg520813/p/11514525.html