C# Panel 打开 Form 窗口的方法

C# Panel 打开 Form 窗口的方法

private void MainForm_Load(object sender, EventArgs e)
{
NavigationForm w = new NavigationForm();

ShowForm(w);
}

public void ShowForm(Form form1)
{

this.panel3.Controls.Clear();

form1.TopLevel = false;

form1.FormBorderStyle = FormBorderStyle.None;

form1.Dock = DockStyle.Fill;

form1.Parent = this.panel3;

this.panel3.Controls.Add(form1);

form1.Show();

}

标签: C# Panel 打开 Form

posted @ 2019-06-08 10:31  grj001  阅读(94)  评论(0编辑  收藏  举报