1. 在Panel加载Windows窗体 :在Panel显示一个名为frmDealPanel的窗体
tabbedView1.BeginUpdate();
// 创建Panel
DockPanel taticsPanel = new DockPanel();
taticsPanel = dockManager1.AddPanel(DockingStyle.Left);
taticsPanel.Text = "WindowsForm Show in DockPanel";
// 创建窗体
Form taticsForm = new frmDealPanel();
// 将窗体的顶级属性设为假,若无此设置,直接加载窗体会报错:无法将顶级控件加载到控件
taticsForm.TopLevel = false;
taticsPanel.Controls.Add(taticsForm);
taticsForm.Dock = DockStyle.Fill;
taticsForm.Show();
tabbedView1.EndUpdate();
唯一需要注意的就是,在加载窗体前,要把窗体的顶级控件属性Toplever设为假即可
2. 在Panel加载用户控件:在Panel上显示名为ucDealPanel的用户控件
tabbedView1.BeginUpdate();
// 创建Panel
DockPane