WinForm 窗体与窗体相互嵌套

只要将要被潜逃的的窗体的TopLeve设置为Flase即可像普通的控件一样,被添加到另外一个窗体中,TopLeve:是否为顶级窗口,下面来看代码:



public partial class TTForm : Form
    {
        public TTForm()
        {
            InitializeComponent();
            weiboOfSina weibo = new weiboOfSina();
            weibo.Dock = DockStyle.Fill;
            weibo.FormBorderStyle = FormBorderStyle.None;
            weibo.TopLevel = false;
            this.Controls.Clear();
            this.Controls.Add(weibo);
            weibo.Show();
        }
    }


posted @ 2014-01-11 14:04  Bodi  阅读(917)  评论(0编辑  收藏  举报