现在有两个窗体 Form1 和Form2
Form1中有控件splitContainer1 和panel 。控件。我们希望Form2在splitContainer1或者panel控件中显示
1:首先看在splitContainer1中显示。splitContainer控件本身就分为panel1和panel2两部分。我们可以上下布局和左右布局。
我这里是上下布局,我把Form2在splitContainer1中的panel1中显示
先把Form1为MDI容器 即属性 IsMdiContainer=true
我把代码写在Form1的load事件中。让窗体加载就显示
private void Form1_Load(object sender, EventArgs e) { //splitContainer1控件 Form2 u = new Form2(); //u.Top = -25; //