public void UnActiveTabPage(MyTabPage tabPage) { this.SuspendLayout(); tabPage.Location = new System.Drawing.Point(-this.Size.Width - 1, 0); this.ResumeLayout(false); this.ActivedTabPage = null; }
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 MyTabNavItem(MyTabControl tabControl, MyTabPage tabPage) { this.TabControl = tabControl ?? throw new ArgumentNullException(); this.TabPage = tabPage ?? throw new ArgumentNullException(); InitializeComponent(); this.Header = TabPage.Header; this.label1.Refresh(); this.flowLayoutPanel.Refresh(); }
public void RemoveTabPage(MyTabPage tabPage) { try { this.Controls.Remove(tabPage); } catch { } }
public void ActiveTabPage(MyTabPage tabPage) { if (ActivedTabPage != null) { UnActiveTabPage(ActivedTabPage); } tabPage.Location = new System.Drawing.Point(this.Size.Width + 1, 0); tabPage.Size = this.Size; if (!this.Controls.Contains(tabPage)) { this.Controls.Add(tabPage); } this.SuspendLayout(); tabPage.Location = new System.Drawing.Point(0, 0); tabPage.Show(); this.ResumeLayout(false); this.ActivedTabPage = tabPage; }
public void ActiveTabPage(MyTabPage tabPage) { TabPageBox.ActiveTabPage(tabPage); }