private void AddTabToUi(ToolboxTab tab) { SuspendLayout(); pnlMain.SuspendLayout(); tab.Dock = DockStyle.Top; tab.ButtonClick += new ToolboxButtonEventHandler(OnButtonClick); tab.ButtonDoubleClick += new ToolboxButtonEventHandler(OnButtonDoubleClick); tab.SelectedButtonChanged += new ToolboxButtonEventHandler(OnSelectedButtonChanged); tab.CollapsedChanged += new EventHandler(OnCollapsedChanged); pnlMain.Controls.Add(tab); if (tab.Collapsed) { tab.OpenTab(); } else { selectedTab = tab; } pnlMain.ResumeLayout(); ResumeLayout(); }
private void AddTabToUi(ToolboxTab tab) { SuspendLayout(); pnlMain.SuspendLayout(); tab.Dock = DockStyle.Top; tab.ButtonClick += new ToolboxButtonEventHandler(OnButtonClick); tab.ButtonDoubleClick += new ToolboxButtonEventHandler(OnButtonDoubleClick); tab.SelectedButtonChanged += new ToolboxButtonEventHandler(OnSelectedButtonChanged); tab.CollapsedChanged += new EventHandler(OnCollapsedChanged); pnlMain.Controls.Add(tab); if (tab.Collapsed) tab.OpenTab(); else selectedTab = tab; pnlMain.ResumeLayout(); ResumeLayout(); }