设置子窗体问题

.Net技术 码拜 7年前 (2017-04-25) 982次浏览
在子窗体中,有一个按钮,为新建窗体,怎么样将这个新建出来的窗体设置为子窗体?
求高手你赐教!
解决方案

20

当前窗体必须是主窗体  IsMdiContainer = true

Form fm = new Form1();
fm.MdiParent = this;
fm.Show();

20

form.Owner

20

Form fm = new Form1();
fm.MdiParent = this.MdiParent;
fm.Show();

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明设置子窗体问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)