winform 将窗体显示到容器中

发布时间:2020-08-11 21:45:59 作者:demon2012d
来源:网络 阅读:512
        
///<summary>
///窗体显示到容器中
///</summary>
///<paramname="frm">要显示的窗体对象</param>
privatevoid FromShowDialog(Formfrm)
{
    //窗口置顶
    frm.TopLevel = false;
    //移除Panel容器里所有窗体
    foreach(Control ctl inpanel_right.Controls)
    {
        if (ctl is Form)
        {
           panel_right.Controls.Remove(ctl);
        }
    }
    //设置父容器
    frm.Parent = this.panel_right;
    //窗体无边框
    frm.FormBorderStyle = FormBorderStyle.None;
    //填满父容器
    frm.Dock = DockStyle.Fill;
    frm.Show();
}


推荐阅读:
  1. 8.WinForm练习--MIDI窗体设计
  2. Winform 不同窗体间方法调用总结

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

winform 将窗体显示到容器中 fo nf

上一篇:列出oracle dbtime得sql语句

下一篇:TinkerTool System for Mac(系统深度设置维护工具)6.9.1免激活版

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》