日期:2014-05-18  浏览次数:20903 次

c# 子窗体在父窗体中运行的属性如何设置?
1.子窗体无边框等,能融入父窗体?
2.子窗体不可移动?

------解决方案--------------------
C# code

                form2 cpt = new form2(this);//form2是子窗体,代码写在父窗体中
                cpt.TopLevel = false;
                cpt.Parent = this.panel1;//要融入的容器panel1
                cpt.WindowState = FormWindowState.Maximized;
                cpt.Dock = DockStyle.Fill;
                cpt.FormBorderStyle = FormBorderStyle.None;
                cpt.Show();