如何将一个Winform嵌入到一个Control当中

/// <summary>
        /// 将一个winform窗体嵌入control中
        /// </summary>
        /// <param name="f">窗体</param>
        /// <param name="c">control</param>
        private void InsertForm(Form f, Control c)
        {
            if (c != null)
            {
                f.TopLevel = false;
                f.Dock = DockStyle.Fill;
                f.FormBorderStyle = FormBorderStyle.None;
                f.MaximizeBox = false;
                f.MinimizeBox = false;
                f.ControlBox = false;
                c.Controls.Add(f);
                f.Show();
            }
        }

 

posted @ 2014-09-22 11:29  ChuckLu  阅读(442)  评论(0编辑  收藏  举报