//反射生成窗体Form fm = (Form)Assembly.GetExecutingAssembly().CreateInstance(form);
//设置窗体没有边框,加入到选项卡中
fm.FormBorderStyle = FormBorderStyle.None;
fm.TopLevel = false;
fm.Parent = ((TabControl)sender).SelectedTab;
fm.ControlBox = false;
fm.Dock = DockStyle.Fill;
fm.Show();
s[((TabControl)sender).SelectedIndex] = 1;
HResult=0x80004005
Message=创建窗口句柄时出错。
Source=System.Windows.Forms
StackTrace:
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
在 System.Windows.Forms.Control.CreateHandle()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.SetVisibleCore(Boolean value)
在 System.Windows.Forms.TabPage.set_Visible(Boolean value)
在 System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus)
在 System.Windows.Forms.TabControl.OnHandleCreated(EventArgs e)
在 System.Windows.Forms.Control.WmCreate(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.TabControl.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)