求助一个主控窗体的问题
问题是这样的:在登录成功后 进入主控画面,在主控画面中点击一个按钮,将一个无边框的窗体填充到主控画面
using System; using System.Collections.Generic; using using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.TopLevel = false; this.FormBorderStyle = FormBorderStyle.None; this.BackColor = Color.Yellow; this.Size = new Size(150, 135); this.Location = new Point(50, 40); } } } using System; using System.Collections.Generic; using using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Form2 frm2; public Form1() { InitializeComponent(); frm2 = new Form2(); frm2.Visible = true; } private void Form1_Load(object sender, EventArgs e) { this.Controls.Add(frm2); } } }}