/// <summary> /// Initializes a new instance of the <see cref="TabControl"/> class. /// </summary> /// <param name="parent">Parent control.</param> public TabControl(Base parent) : base(parent) { m_Scroll = new ScrollBarButton[2]; m_ScrollOffset = 0; m_TabStrip = new TabStrip(this); m_TabStrip.StripPosition = Pos.Top; // Make this some special control? m_Scroll[0] = new ScrollBarButton(this); m_Scroll[0].SetDirectionLeft(); m_Scroll[0].Clicked += ScrollPressedLeft; m_Scroll[0].SetSize(14, 16); m_Scroll[1] = new ScrollBarButton(this); m_Scroll[1].SetDirectionRight(); m_Scroll[1].Clicked += ScrollPressedRight; m_Scroll[1].SetSize(14, 16); m_InnerPanel = new TabControlInner(this); m_InnerPanel.Dock = Pos.Fill; m_InnerPanel.SendToBack(); IsTabable = false; }
/// <summary> /// Initializes a new instance of the <see cref="TabControl"/> class. /// </summary> /// <param name="parent">Parent control.</param> public TabControl(ControlBase parent) : base(parent) { m_TabStrip = new TabStrip(this); m_TabStrip.StripPosition = Dock.Top; // Actually these should be inside the TabStrip but it would make things complicated // because TabStrip contains only TabButtons. ScrollButtons being here we don't need // an inner panel for TabButtons on the TabStrip. m_Scroll = new ScrollBarButton[2]; m_Scroll[0] = new ScrollBarButton(this); m_Scroll[0].SetDirectionLeft(); m_Scroll[0].Clicked += ScrollPressedLeft; m_Scroll[0].Size = new Size(BaseUnit); m_Scroll[1] = new ScrollBarButton(this); m_Scroll[1].SetDirectionRight(); m_Scroll[1].Clicked += ScrollPressedRight; m_Scroll[1].Size = new Size(BaseUnit); m_InnerPanel = new TabControlInner(this); m_InnerPanel.Dock = Dock.Fill; m_InnerPanel.SendToBack(); IsTabable = false; m_ActualPadding = new Padding(6, 6, 6, 6); }