public void AddTab(Control Panel, string tabTitle, bool SwitchTo = false) { if (Panel != null) { if (!Panel.Initialized) { Panel.Initialize(); } Panel.Parent = this; _pagelist.Add(Panel); } var bar = new TabBar(fnt, fntNoShadow) { Parent = this, Top = 0, Left = _tablist.Count * 120, Right = _tablist.Count * 120, Margin = TabMargin, }; bar.Initialize(); bar.Parent = this; bar.TabID = _tablist.Count; bar.Title = tabTitle; bar.Click += SwitchTab; foreach (TabBar t in _tablist) { t.Selected = false; } _tablist.Add(bar); SwitchTab(_tablist.Count - 1); }
public void AddTab(Control Panel, string tabTitle, bool SwitchTo = false) { if(Panel !=null) { if (!Panel.Initialized) Panel.Initialize(); Panel.Parent = this; _pagelist.Add(Panel); } var bar = new TabBar(fnt,fntNoShadow) { Parent=this, Top=0, Left = _tablist.Count * 120, Right= _tablist.Count * 120, Margin = TabMargin, }; bar.Initialize(); bar.Parent = this; bar.TabID = _tablist.Count; bar.Title = tabTitle; bar.Click += SwitchTab; foreach (TabBar t in _tablist) { t.Selected = false; } _tablist.Add(bar); SwitchTab(_tablist.Count - 1); }