/// <summary> /// Adds a page/tab. /// </summary> /// <param name="button">Page to add. (well, it's a TabButton which is a parent to the page).</param> public void AddPage(TabButton button) { Base page = button.Page; page.Parent = this; page.IsHidden = true; page.Margin = new Margin(6, 6, 6, 6); page.Dock = Pos.Fill; button.Parent = m_TabStrip; button.Dock = Pos.Left; button.SizeToContents(); if (button.TabControl != null) { button.TabControl.UnsubscribeTabEvent(button); } button.TabControl = this; button.Clicked += OnTabPressed; if (null == m_CurrentButton) { button.Press(); } if (TabAdded != null) { TabAdded.Invoke(this); } Invalidate(); }
/// <summary> /// Adds a page/tab. /// </summary> /// <param name="button">Page to add. (well, it's a TabButton which is a parent to the page).</param> internal void AddPage(TabButton button) { ControlBase page = button.Page; page.Parent = this; page.IsHidden = true; page.Dock = Dock.Fill; page.Margin = (Margin)this.Padding; button.Parent = m_TabStrip; if (button.TabControl != null) { button.TabControl.UnsubscribeTabEvent(button); } button.TabControl = this; button.Clicked += OnTabPressed; if (null == m_CurrentButton) { button.Press(); } if (TabAdded != null) { TabAdded.Invoke(this, EventArgs.Empty); } Invalidate(); }
/// <summary> /// Adds a page/tab. /// </summary> /// <param name="button">Page to add. (well, it's a TabButton which is a parent to the page).</param> public void AddPage(TabButton button) { Base page = button.Page; page.Parent = this; page.IsHidden = true; page.Margin = new Margin(6, 6, 6, 6); page.Dock = Pos.Fill; button.Parent = m_TabStrip; button.Dock = Pos.Left; button.SizeToContents(); if (button.TabControl != null) button.TabControl.UnsubscribeTabEvent(button); button.TabControl = this; button.Clicked += OnTabPressed; if (null == m_CurrentButton) { button.Press(); } if (TabAdded != null) TabAdded.Invoke(this); Invalidate(); }