Test those things

I have three forms, one is the main form main, which has a panel, initialization time, main display panel in the form form1, and then I want to click a button in form1, form2 main display panel in the middle.

public Form1(Panel p1)

         {
             InitializeComponent();
             p = p1;
         }
 
         private  void  button1_Click( object  sender, EventArgs e)
         {
             Form2 f2 =  new  Form2();
             f2.TopLevel =  false ;
             f2.Parent = p;
             f2.Show();
             this .Close();
         }

Guess you like

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