private void AddTab(TabBase tab) { tab.menuItem = this.Menu.MenuItems.Add("[" + tab.Name + "]", (s, e) => { SetTab(tab); }); tabs.Add(tab); }
public void SetTab(TabBase tab) { if (curTab != null) { curTab.SetShowing(false); this.Controls.RemoveAt(0); } curTab = tab; tab.View.Dock = DockStyle.Fill; this.Controls.Add(tab.View); curTab.SetShowing(true); OnTabChanged(tab); }
protected override void OnTabChanged(TabBase tab) { }
protected virtual void OnTabChanged(TabBase tab) { this.Text = tab.Name; }