/// <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) { TabPage page = button.Page; page.Parent = this; page.IsHidden = true; page.Margin = new Margin(6, 6, 6, 6); page.Dock = Dock.Fill; button.Parent = m_TabStrip; button.Dock = Dock.Left; if (button.TabControl != null) { button.TabControl.UnsubscribeTabEvent(button); } button.TabControl = this; button.Clicked += OnTabPressed; if (m_CurrentButton == null) { button.Press(); } if (TabAdded != null) { TabAdded.Invoke(this, EventArgs.Empty); } Invalidate(); }
public void FocusTab() { TabButton.Press(); }