public void AddTabNavItem(MyTabNavItem item) { this.SuspendLayout(); this.flowLayoutPanel.Controls.Add(item); this.ResumeLayout(false); this.TabNavItems.Add(item); this.ActiveTabNavItem(item); }
public void AddPage(string header, Control content) { var page = new MyTabPage(this, header, content); var navItem = new MyTabNavItem(this, page); TabNav.AddTabNavItem(navItem); TabPageBox.ActiveTabPage(page); }
public void ActiveTabNavItem(MyTabNavItem item) { var old = this.TabNavItems.FirstOrDefault(nav => nav.IsActived == true); if (old == item) { return; } if (old != null) { old.IsActived = false; } item.IsActived = true; }
public void RemoveTabNavItem(MyTabNavItem item) { MyTabNavItem nextItem = null; try { var index = this.flowLayoutPanel.Controls.IndexOf(item); this.flowLayoutPanel.Controls.Remove(item); this.TabNavItems.Remove(item); if (index > this.flowLayoutPanel.Controls.Count - 1) { index = this.flowLayoutPanel.Controls.Count - 1; } nextItem = (MyTabNavItem)this.flowLayoutPanel.Controls[index]; } catch { } if (nextItem != null) { TabControl.AcitveTabNavItem(nextItem); } }
public void CloseTabPage(MyTabNavItem item) { }
public void AcitveTabNavItem(MyTabNavItem item) { TabNav.ActiveTabNavItem(item); }