winform 填充panel
2021-03-14 21:32
标签:sele private TreeView border fill 设置 内容 cte xxx public void CreatForm(Form frm) private void TreeView1_AfterSelect(object sender, TreeViewEventArgs e) winform 填充panel 标签:sele private TreeView border fill 设置 内容 cte xxx 原文地址:https://www.cnblogs.com/mig21/p/12455034.html
{
panel1.Controls.Clear();//清除panel里面得所有内容
frm.TopLevel = false; //取消顶级
frm.FormBorderStyle = FormBorderStyle.None;//将边框设置为无边框,无法拖动
frm.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
frm.Dock = DockStyle.Fill; //填充整个Panel容器
panel1.Controls.Add(frm); //将传进来的窗体添加到Panel容器中
frm.Show();
}
{
switch (treeView1.SelectedNode.Text)
{
case "xxx":
CreatForm(new unit());
break;
case "xxx":