/// <summary> /// Initialize tab control page. /// </summary> /// <param name="text">Text to be displayed on the tab.</param> private void Initialize(string text) { // Set button text this.Text = text; // Initialize Panel properties this.Visible = false; this.Dock = DockStyle.Fill; this.DockPadding.Left = 5; this.DockPadding.Right = 2; this.DockPadding.Top = 5; this.DockPadding.Bottom = 2; // Change control style //this.SetStyle(ControlStyles.ResizeRedraw, true); // Create tab page button tabButton = new VerticalTabPageButton(); tabButton.Text = text; tabButton.Dock = DockStyle.Top; tabButton.FlatStyle = FlatStyle.Standard; tabButton.ImageAlign = ContentAlignment.MiddleLeft; tabButton.TextAlign = ContentAlignment.MiddleLeft; // Hookup to the button events tabButton.DragOver += new DragEventHandler(OnButtonDragOver); tabButton.MouseDown += new MouseEventHandler(OnButtonMouseDown); tabButton.Click += new EventHandler(OnButtonMouseClick); tabButton.StartDragging += new EventHandler(OnButtonStartDragging); }
/// <summary> /// Initialize tab control page. /// </summary> /// <param name="text">Text to be displayed on the tab.</param> private void Initialize(string text) { // Set button text this.Text = text; // Initialize Panel properties this.Visible = false; this.Dock = DockStyle.Fill; this.DockPadding.Left = 5; this.DockPadding.Right = 2; this.DockPadding.Top = 5; this.DockPadding.Bottom = 2; // Change control style //this.SetStyle(ControlStyles.ResizeRedraw, true); // Create tab page button tabButton = new VerticalTabPageButton(); tabButton.Text = text; tabButton.Dock = DockStyle.Top; tabButton.FlatStyle = FlatStyle.Standard; tabButton.ImageAlign = ContentAlignment.MiddleLeft; tabButton.TextAlign = ContentAlignment.MiddleLeft; // Hookup to the button events tabButton.DragOver += new DragEventHandler(OnButtonDragOver); tabButton.MouseDown += new MouseEventHandler(OnButtonMouseDown); tabButton.Click += new EventHandler(OnButtonMouseClick); tabButton.StartDragging += new EventHandler(OnButtonStartDragging); }