private void CloseMachineSetting(object sender, EventArgs e) { if (_machineGroupSetting != null) { _machineGroupSetting.Dispose(); _machineGroupSetting = null; } }
private void btnMachineGroupSetting_Click(object sender, EventArgs e) { if (_machineGroupSetting == null) { _machineGroupSetting = new MachineSignalStatusGroup(); //WeifenLuo.WinFormsUI.Docking.DockPane dockPane = (WeifenLuo.WinFormsUI.Docking.DockPane)this.Parent; _machineGroupSetting.BaseDockPanel = this.DockPanel; _machineGroupSetting.Show(this.DockPanel, this.DockState); _machineGroupSetting.Disposed += new EventHandler(ActivateTab); _machineGroupSetting.Disposed += new EventHandler(CloseMachineSetting); } else { _machineGroupSetting.Show(this.DockPanel, this.DockState); } //_machineGroupSetting.TopLevel = false; //_machineGroupSetting.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //this.Parent.Controls.Add(_machineGroupSetting); //_machineGroupSetting.Show(); }