Class TabControlAdv
Manages a set of tab pages.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
[DefaultChildType(typeof(TabPageAdv))]
public class TabControlAdv : BaseControl, IThemeProvider, IVisualStyle, IDisposable, ITabControl, ISupportInitialize, ISupportOffice2007Theme
Remarks
A TabControlAdv contains tab pages, which are represented by TabPageAdv objects that you add through the TabPages property.
It provides a set of pre-built tab types(TabStyle property) with different look and feel, allows you to align the tabs to either of the four sides of the Control (Alignment property), can be used in a singleline or multiline mode(Multiline property) and provides a broad set of properties which affects its appearance and behavior.
It also provides you a simple event based mechanism (DrawItem event) to customize the drawing of the tabs.
To enable themes support in XP, turn on the ThemesEnabled property.
Examples
The following example uses the Visual Studio .NET Windows Forms Designer to create a TabControlAdv with three tab pages. Each tab page contains several controls.
public class Form1 : System.Windows.Forms.Form
{
private Syncfusion.Windows.Forms.Tools.TabControlAdv TabControlAdv1;
private System.Windows.Forms.Label tab2label1;
private System.Windows.Forms.Button tab3Button;
private System.Windows.Forms.MonthCalendar tab3monthCalendar1;
private System.Windows.Forms.DateTimePicker tab3dateTimePicker1;
private System.Windows.Forms.Label tab3label;
private System.Windows.Forms.Label tab2label2;
private System.Windows.Forms.TextBox tab2textBox1;
private System.Windows.Forms.ListBox tab1listBox1;
private System.Windows.Forms.ComboBox tab1comboBox1;
private System.Windows.Forms.Label tab1label1;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab1;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab3;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab2;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tab2label1 = new System.Windows.Forms.Label();
this.tab1 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab1listBox1 = new System.Windows.Forms.ListBox();
this.tab1comboBox1 = new System.Windows.Forms.ComboBox();
this.tab1label1 = new System.Windows.Forms.Label();
this.tab3 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab3Button = new System.Windows.Forms.Button();
this.tab3monthCalendar1 = new System.Windows.Forms.MonthCalendar();
this.tab3dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.tab3label = new System.Windows.Forms.Label();
this.tab2 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab2label2 = new System.Windows.Forms.Label();
this.tab2textBox1 = new System.Windows.Forms.TextBox();
this.TabControlAdv1 = new Syncfusion.Tools.Windows.Forms.Tab.TabControlAdv();
this.tab1.SuspendLayout();
this.tab3.SuspendLayout();
this.tab2.SuspendLayout();
this.TabControlAdv1.SuspendLayout();
this.SuspendLayout();
//
// tab2label1
//
this.tab2label1.Dock = System.Windows.Forms.DockStyle.Top;
this.tab2label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab2label1.Name = "tab2label1";
this.tab2label1.Size = new System.Drawing.Size(373, 48);
this.tab2label1.TabIndex = 0;
this.tab2label1.Text = "Tab2";
this.tab2label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.tab2label1.Paint += new System.Windows.Forms.PaintEventHandler(this.TabPageAdv1_Paint);
//
// tab1
//
this.tab1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tab1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab1listBox1,
this.tab1comboBox1,
this.tab1label1});
this.tab1.Location = new System.Drawing.Point(1, 29);
this.tab1.Name = "tab1";
this.tab1.Size = new System.Drawing.Size(373, 257);
this.tab1.TabIndex = 0;
this.tab1.Text = "Tab 1";
this.tab1.ToolTipText = "0asdfasdf";
//
// tab1listBox1
//
this.tab1listBox1.Items.AddRange(new object[] {
"Item 1",
"Item 2",
"Item 3"});
this.tab1listBox1.Location = new System.Drawing.Point(8, 88);
this.tab1listBox1.Name = "tab1listBox1";
this.tab1listBox1.Size = new System.Drawing.Size(192, 147);
this.tab1listBox1.TabIndex = 2;
//
// tab1comboBox1
//
this.tab1comboBox1.DropDownWidth = 192;
this.tab1comboBox1.Location = new System.Drawing.Point(8, 56);
this.tab1comboBox1.Name = "tab1comboBox1";
this.tab1comboBox1.Size = new System.Drawing.Size(192, 21);
this.tab1comboBox1.TabIndex = 1;
this.tab1comboBox1.Text = "comboBox1";
//
// tab1label1
//
this.tab1label1.Dock = System.Windows.Forms.DockStyle.Top;
this.tab1label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab1label1.Name = "tab1label1";
this.tab1label1.Size = new System.Drawing.Size(371, 48);
this.tab1label1.TabIndex = 0;
this.tab1label1.Text = "Tab Page 1";
this.tab1label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tab3
//
this.tab3.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab3Button,
this.tab3monthCalendar1,
this.tab3dateTimePicker1,
this.tab3label});
this.tab3.Location = new System.Drawing.Point(1, 29);
this.tab3.Name = "tab3";
this.tab3.Size = new System.Drawing.Size(373, 257);
this.tab3.TabIndex = 1;
this.tab3.Text = "Tab 3";
this.tab3.ToolTipText = "2asdfasdf";
this.tab3.Layout += new System.Windows.Forms.LayoutEventHandler(this.TabPageAdv2_Layout);
//
// tab3Button
//
this.tab3Button.Location = new System.Drawing.Point(264, 72);
this.tab3Button.Name = "tab3Button";
this.tab3Button.Size = new System.Drawing.Size(72, 24);
this.tab3Button.TabIndex = 3;
this.tab3Button.Text = "button1";
this.tab3Button.Click += new System.EventHandler(this.button1_Click);
//
// tab3monthCalendar1
//
this.tab3monthCalendar1.Location = new System.Drawing.Point(16, 96);
this.tab3monthCalendar1.Name = "tab3monthCalendar1";
this.tab3monthCalendar1.TabIndex = 2;
//
// tab3dateTimePicker1
//
this.tab3dateTimePicker1.Location = new System.Drawing.Point(8, 64);
this.tab3dateTimePicker1.Name = "tab3dateTimePicker1";
this.tab3dateTimePicker1.TabIndex = 1;
//
// tab3label
//
this.tab3label.Dock = System.Windows.Forms.DockStyle.Top;
this.tab3label.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab3label.Name = "tab3label";
this.tab3label.Size = new System.Drawing.Size(373, 48);
this.tab3label.TabIndex = 0;
this.tab3label.Text = "Tab3";
this.tab3label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tab2
//
this.tab2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab2label2,
this.tab2textBox1,
this.tab2label1});
this.tab2.Location = new System.Drawing.Point(1, 29);
this.tab2.Name = "tab2";
this.tab2.Size = new System.Drawing.Size(373, 257);
this.tab2.TabIndex = 2;
this.tab2.Text = "Tab2";
this.tab2.ToolTipText = "1asdfasdfasd";
//
// tab2label2
//
this.tab2label2.Location = new System.Drawing.Point(8, 96);
this.tab2label2.Name = "tab2label2";
this.tab2label2.Size = new System.Drawing.Size(112, 16);
this.tab2label2.TabIndex = 2;
this.tab2label2.Text = "Text Entry:";
//
// tab2textBox1
//
this.tab2textBox1.Location = new System.Drawing.Point(8, 120);
this.tab2textBox1.Multiline = true;
this.tab2textBox1.Name = "tab2textBox1";
this.tab2textBox1.Size = new System.Drawing.Size(368, 80);
this.tab2textBox1.TabIndex = 1;
this.tab2textBox1.Text = "textBox1";
//
// TabControlAdv1
//
this.TabControlAdv1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.TabControlAdv1.BackColor = System.Drawing.SystemColors.ActiveBorder;
this.TabControlAdv1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab3,
this.tab2,
this.tab1});
this.TabControlAdv1.Cursor = System.Windows.Forms.Cursors.Default;
this.TabControlAdv1.HotTrack = true;
this.TabControlAdv1.ImageList = this.imageList1;
this.TabControlAdv1.ItemSize = new System.Drawing.Size(80, 30);
this.TabControlAdv1.Location = new System.Drawing.Point(40, 16);
this.TabControlAdv1.Name = "TabControlAdv1";
this.TabControlAdv1.ShowToolTips = true;
this.TabControlAdv1.Size = new System.Drawing.Size(376, 288);
this.TabControlAdv1.TabGap = 20;
this.TabControlAdv1.TabIndex = 4;
this.TabControlAdv1.TabStyle = typeof(Syncfusion.Tools.Windows.Forms.Tab.TabRenderer2D);
this.TabControlAdv1.TextAlignment = System.Drawing.StringAlignment.Near;
this.TabControlAdv1.UserMoveTabs = true;
this.TabControlAdv1.VSLikeScrollButton = true;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(688, 309);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.TabControlAdv1});
this.Name = "Form1";
this.Text = "Form1";
this.tab1.ResumeLayout(false);
this.tab3.ResumeLayout(false);
this.tab2.ResumeLayout(false);
this.TabControlAdv1.ResumeLayout(false);
this.ResumeLayout(false);
}
}
Private Function Form1() As Public
'
' Required for Windows Form Designer support
'
InitializeComponent()
End Function
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.tab2label1 = New System.Windows.Forms.Label()
Me.tab1 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab1listBox1 = New System.Windows.Forms.ListBox()
Me.tab1comboBox1 = New System.Windows.Forms.ComboBox()
Me.tab1label1 = New System.Windows.Forms.Label()
Me.tab3 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab3Button = New System.Windows.Forms.Button()
Me.tab3monthCalendar1 = New System.Windows.Forms.MonthCalendar()
Me.tab3dateTimePicker1 = New System.Windows.Forms.DateTimePicker()
Me.tab3label = New System.Windows.Forms.Label()
Me.tab2 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab2label2 = New System.Windows.Forms.Label()
Me.tab2textBox1 = New System.Windows.Forms.TextBox()
Me.TabControlAdv1 = New Syncfusion.Tools.Windows.Forms.Tab.TabControlAdv()
Me.tab1.SuspendLayout()
Me.tab3.SuspendLayout()
Me.tab2.SuspendLayout()
Me.TabControlAdv1.SuspendLayout()
Me.SuspendLayout()
'
' tab2label1
'
Me.tab2label1.Dock = System.Windows.Forms.DockStyle.Top
Me.tab2label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab2label1.Name = "tab2label1"
Me.tab2label1.Size = New System.Drawing.Size(373, 48)
Me.tab2label1.TabIndex = 0
Me.tab2label1.Text = "Tab2"
Me.tab2label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.tab2label1.Paint += New System.Windows.Forms.PaintEventHandler(Me.TabPageAdv1_Paint)
'
' tab1
'
Me.tab1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.tab1.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab1listBox1,Me.tab1comboBox1,Me.tab1label1})
Me.tab1.Location = New System.Drawing.Point(1, 29)
Me.tab1.Name = "tab1"
Me.tab1.Size = New System.Drawing.Size(373, 257)
Me.tab1.TabIndex = 0
Me.tab1.Text = "Tab 1"
Me.tab1.ToolTipText = "0asdfasdf"
'
' tab1listBox1
'
Me.tab1listBox1.Items.AddRange(New System.Windows.Forms.Control()
{Me.tab1listBox1,Me.tab1comboBox1,Me.tab1label1})
Dim Object() As Me.tab1listBox1.Items.AddRange(New string()
{
"Item 1",
"Item 2",
"Item 3"
})
Me.tab1listBox1.Location = New System.Drawing.Point(8, 88)
Me.tab1listBox1.Name = "tab1listBox1"
Me.tab1listBox1.Size = New System.Drawing.Size(192, 147)
Me.tab1listBox1.TabIndex = 2
'
' tab1comboBox1
'
Me.tab1comboBox1.DropDownWidth = 192
Me.tab1comboBox1.Location = New System.Drawing.Point(8, 56)
Me.tab1comboBox1.Name = "tab1comboBox1"
Me.tab1comboBox1.Size = New System.Drawing.Size(192, 21)
Me.tab1comboBox1.TabIndex = 1
Me.tab1comboBox1.Text = "comboBox1"
'
' tab1label1
'
Me.tab1label1.Dock = System.Windows.Forms.DockStyle.Top
Me.tab1label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab1label1.Name = "tab1label1"
Me.tab1label1.Size = New System.Drawing.Size(371, 48)
Me.tab1label1.TabIndex = 0
Me.tab1label1.Text = "Tab Page 1"
Me.tab1label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.tab3.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab3Button,Me.tab3monthCalendar1,Me.tab3dateTimePicker1,Me.tab3label})
Me.tab3.Location = New System.Drawing.Point(1, 29)
Me.tab3.Name = "tab3"
Me.tab3.Size = New System.Drawing.Size(373, 257)
Me.tab3.TabIndex = 1
Me.tab3.Text = "Tab 3"
Me.tab3.ToolTipText = "2asdfasdf"
Me.tab3.Lay+= New System.Windows.Forms.LayoutEventHandler(Me.TabPageAdv2_Layout)
'
' tab3Button
'
Me.tab3Button.Location = New System.Drawing.Point(264, 72)
Me.tab3Button.Name = "tab3Button"
Me.tab3Button.Size = New System.Drawing.Size(72, 24)
Me.tab3Button.TabIndex = 3
Me.tab3Button.Text = "button1"
Me.tab3Button.Click += New System.EventHandler(Me.button1_Click)
'
' tab3monthCalendar1
'
Me.tab3monthCalendar1.Location = New System.Drawing.Point(16, 96)
Me.tab3monthCalendar1.Name = "tab3monthCalendar1"
Me.tab3monthCalendar1.TabIndex = 2
'
' tab3dateTimePicker1
'
Me.tab3dateTimePicker1.Location = New System.Drawing.Point(8, 64)
Me.tab3dateTimePicker1.Name = "tab3dateTimePicker1"
Me.tab3dateTimePicker1.TabIndex = 1
'
' tab3label
'
Me.tab3label.Dock = System.Windows.Forms.DockStyle.Top
Me.tab3label.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab3label.Name = "tab3label"
Me.tab3label.Size = New System.Drawing.Size(373, 48)
Me.tab3label.TabIndex = 0
Me.tab3label.Text = "Tab3"
Me.tab3label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
' tab2
'
Me.tab2.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab2label2,Me.tab2textBox1,Me.tab2label1})
Me.tab2.Location = New System.Drawing.Point(1, 29)
Me.tab2.Name = "tab2"
Me.tab2.Size = New System.Drawing.Size(373, 257)
Me.tab2.TabIndex = 2
Me.tab2.Text = "Tab2"
Me.tab2.ToolTipText = "1asdfasdfasd"
'
' tab2label2
'
Me.tab2label2.Location = New System.Drawing.Point(8, 96)
Me.tab2label2.Name = "tab2label2"
Me.tab2label2.Size = New System.Drawing.Size(112, 16)
Me.tab2label2.TabIndex = 2
Me.tab2label2.Text = "Text Entry:"
'
' tab2textBox1
'
Me.tab2textBox1.Location = New System.Drawing.Point(8, 120)
Me.tab2textBox1.Multiline = True
Me.tab2textBox1.Name = "tab2textBox1"
Me.tab2textBox1.Size = New System.Drawing.Size(368, 80)
Me.tab2textBox1.TabIndex = 1
Me.tab2textBox1.Text = "textBox1"
'
' TabControlAdv1
'
Me.TabControlAdv1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right)
Me.TabControlAdv1.Cursor = System.Windows.Forms.Cursors.Default
Me.TabControlAdv1.HotTrack = True
Me.TabControlAdv1.ImageList = Me.imageList1
Me.TabControlAdv1.ItemSize = New System.Drawing.Size(80, 30)
Me.TabControlAdv1.Location = New System.Drawing.Point(40, 16)
Me.TabControlAdv1.Name = "TabControlAdv1"
Me.TabControlAdv1.ShowToolTips = True
Me.TabControlAdv1.Size = New System.Drawing.Size(376, 288)
Me.TabControlAdv1.TabGap = 20
Me.TabControlAdv1.TabIndex = 4
Me.TabControlAdv1.TabStyle = Type.GetType(Syncfusion.Tools.Windows.Forms.Tab.TabRenderer2D)
Me.TabControlAdv1.TextAlignment = System.Drawing.StringAlignment.Near
Me.TabControlAdv1.UserMoveTabs = True
Me.TabControlAdv1.VSLikeScrollButton = True
'
' Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(688, 309)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.TabControlAdv1})
Me.Name = "Form1"
Me.Text = "Form1"
Me.tab1.ResumeLayout(False)
Me.tab3.ResumeLayout(False)
Me.tab2.ResumeLayout(False)
Me.TabControlAdv1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Constructors
TabControlAdv()
Initializes a new instance of the TabControl class.
Declaration
public TabControlAdv()
Examples
The following example creates a TabControlAdv with one TabPageAdv object. The constructor instantiates tabControl1. Use the Syncfusion.Windows.Forms.Tools namespace for this example.
public Form1()
{
this.tabPage1 = new TabPageAdv();
// Invokes the TabControlAdv() constructor to create the tabControl1 object.
this.tabControl1 = new TabControlAdv();
this.tabControl1.Controls.Add(tabPage1);
this.Controls.Add(tabControl1);
}
Public Sub New()
Me.tabPage1 = New TabPageAdv()
' Invokes the TabControlAdv() constructor to create the tabControl1 object.
Me.tabControl1 = New TabControlAdv()
Me.tabControl1.Controls.Add(tabPage1)
Me.Controls.Add(tabControl1)
End Sub 'New
Fields
m_sbScrollButtons
Declaration
protected ScrollButtons m_sbScrollButtons
Field Value
| Type |
|---|
| ScrollButtons |
m_tabPanelRenderer
Declaration
protected ITabPanelRenderer m_tabPanelRenderer
Field Value
| Type |
|---|
| ITabPanelRenderer |
Properties
ActiveTabColor
Gets or sets the backcolor of the active tabs. Will be overridden by any individual Tab BackColor in the TabPageAdv instance, if any.
Declaration
public virtual Color ActiveTabColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
ActiveTabFont
Gets or sets the font of the text displayed by the active tab.
Declaration
public virtual Font ActiveTabFont { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Font | The Font object to apply to the text displayed by the control. The default is the value of the Font property. |
ActiveTabForeColor
Gets or sets the forecolor of the active tab page.
Declaration
public virtual Color ActiveTabForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Empty. |
AdjustTopGap
Adjusts the gap between the tabControlAdv's top and the tabs.
Declaration
public virtual int AdjustTopGap { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Alignment
Gets or sets the area of the control (for example, along the top) where the tabs are aligned.
Declaration
public virtual TabAlignment Alignment { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Forms.TabAlignment | One of the TabAlignment values. The default is Top. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
BackgroundImage
Gets or sets the background image displayed in the TabControlAdv. Overridden. See System.Windows.Forms.Control.BackgroundImage.
Declaration
public override Image BackgroundImage { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Image | An System.Drawing.Image that represents the image to display in the background of the TabControlAdv. |
BackgroundImageLayout
Overridden. See System.Windows.Forms.Control.BackgroundImageLayout.
Declaration
public override ImageLayout BackgroundImageLayout { get; set; }
Property Value
| Type |
|---|
| System.Windows.Forms.ImageLayout |
BeforeTouchSize
Gets/Sets Control size before touch enabled
Declaration
public Size BeforeTouchSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
BorderColor
Gets or sets color of the custom borders.
Declaration
public Color BorderColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
BorderStyle
Gets or sets the border style for the tab control.
Declaration
public virtual BorderStyle BorderStyle { get; set; }
Property Value
| Type |
|---|
| System.Windows.Forms.BorderStyle |
BorderVisible
Gets or sets visibility of the custom borders.
Declaration
public bool BorderVisible { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
BorderWidth
Gets or sets width of the custom borders.
Declaration
public int BorderWidth { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
CloseButtonBackColor
Gets or sets the value whether close button BackColor.
Declaration
public Color CloseButtonBackColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
CloseButtonForeColor
Gets or sets the forecolor of the close button.
Declaration
public virtual Color CloseButtonForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Empty. |
CloseButtonHoverForeColor
Gets or sets the forecolor of the close button in hover state.
Declaration
public virtual Color CloseButtonHoverForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Empty. |
CloseButtonPressedForeColor
Gets or sets the forecolor of the close button in pressed state.
Declaration
public virtual Color CloseButtonPressedForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Empty. |
CloseTabOnMiddleClick
Gets or sets the value whether the tabs should close on mouse wheel click.
Declaration
public bool CloseTabOnMiddleClick { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
CurDefaultTabPanelProperties
Returns the current ITabPanelDefaultProperties used by the tab control to render the tab panel.
Declaration
protected ITabPanelDefaultProperties CurDefaultTabPanelProperties { get; }
Property Value
| Type |
|---|
| ITabPanelDefaultProperties |
DefaultSize
Gets the default size of the control.
Declaration
protected override Size DefaultSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Size | The default System.Drawing.Size of the control. |
DisableInactivePageImage
Indicates whether image should be disabled when TabPage is not selected.
Declaration
public virtual bool DisableInactivePageImage { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
DisplayRectangle
Gets the DisplayRectangle. Overridden. See System.Windows.Forms.Control.DisplayRectangle.
Declaration
public override Rectangle DisplayRectangle { get; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
EnableTouchMode
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Scale factor will be updated automatically if scalefactor is equal to 1
FixedSingleBorderColor
Gets or sets the border color when the BorderStyle is FixedSingle.
Declaration
public virtual Color FixedSingleBorderColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
FocusOnTabClick
Indicates whether the Control should take focus when one of the tabs is clicked.
Declaration
public virtual bool FocusOnTabClick { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Note that this will however still set focus on the tab control when the user tabs around to set focus on different controls. You should then use the TabStop property to prevent focus on tab.
Font
Overridden. See System.Windows.Forms.Control.Font.
Declaration
public override Font Font { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Font |
ForeColor
Overridden. See System.Windows.Forms.Control.ForeColor.
Declaration
public override Color ForeColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
HotTrack
Indicates whether tabs change in appearance when the mouse passes over them.
Declaration
public virtual bool HotTrack { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to turn on hot-tracking; false otherwise. Default is false. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
ImageAlignmentR
Gets or sets the relative alignment of the Image with respect to the text.
Declaration
public virtual RelativeImageAlignment ImageAlignmentR { get; set; }
Property Value
| Type | Description |
|---|---|
| RelativeImageAlignment | One of the RelativeImageAlignment values. Default is RelativeImageAlignment.LeftOfText. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
ImageList
Gets or sets the images to be displayed on the control's tabs.
Declaration
public virtual ImageList ImageList { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Forms.ImageList | An ImageList that specifies the images to display on the tabs. |
Remarks
To display an image on a tab, set the ImageIndex property of that TabPageAdv. The ImageIndex acts as the index into the ImageList.
ImageOffset
Gets / Sets the ImageOffset. Adjust y-position of the image.
Declaration
public virtual int ImageOffset { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
InactiveCloseButtonForeColor
Gets or sets the forecolor of the close button for inactive state.
Declaration
public virtual Color InactiveCloseButtonForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Black. |
InactiveTabColor
Gets or sets the color of the inactive Tabs. Will be overridden by any individual Tab BackColor in the TabPageAdv instance, if any.
Declaration
public virtual Color InactiveTabColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
InActiveTabForeColor
Gets or sets the forecolor of the inactive tab page.
Declaration
public virtual Color InActiveTabForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The default value is Color.Empty. |
Is2DStyle
Gets a value indicating whether the tabStyle is TabRenderer2D style.
Declaration
protected bool Is2DStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsBlendDarkStyle
Gets a value indicating whether the tabStyle is BlendDark style.
Declaration
protected virtual bool IsBlendDarkStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsBlendLightStyle
Gets a value indicating whether the tabStyle is BlendLight style.
Declaration
protected virtual bool IsBlendLightStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsDockingWhidbeyStyle
Indicates whether the TabStyle is DockingWhidbey.
Declaration
protected bool IsDockingWhidbeyStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsDockingWhidbeyStyleBeta
Gets a value indicating whether the TabStyle is DockingWhidbeyBeta.
Declaration
protected bool IsDockingWhidbeyStyleBeta { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsEditing
Gets a value indicating whether the text is in editing mode.
Declaration
protected bool IsEditing { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsIE7Style
Gets a value indicating whether the tabStyle is Whidbey style.
Declaration
protected virtual bool IsIE7Style { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsInitializing
Returns whether the TabControlAdv is initializing.
Declaration
protected bool IsInitializing { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsMetroStyle
Indicates whether the TabStyle is Metro.
Declaration
protected virtual bool IsMetroStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2003Style
Gets a value indicating whether the tabStyle is Office2003 style.
Declaration
protected virtual bool IsOffice2003Style { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2007Style
Gets a value indicating whether the TabStyle is Office2007.
Declaration
protected virtual bool IsOffice2007Style { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2010Style
Gets a value indicating whether the TabStyle is Office2010.
Declaration
protected virtual bool IsOffice2010Style { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2016BlackStyle
Indicates whether the TabStyle is Office2016Black.
Declaration
protected virtual bool IsOffice2016BlackStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2016ColorfulStyle
Indicates whether the TabStyle is Office2016Colorful.
Declaration
protected virtual bool IsOffice2016ColorfulStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2016DarkGrayStyle
Indicates whether the TabStyle is Office2016DarkGray.
Declaration
protected virtual bool IsOffice2016DarkGrayStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOffice2016WhiteStyle
Indicates whether the TabStyle is Office2016White.
Declaration
protected virtual bool IsOffice2016WhiteStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOneNoteStyle
Gets a value indicating whether the tabStyle is OneNote style.
Declaration
protected bool IsOneNoteStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsOneNoteStyleFlatTabs
Gets a value indicating whether the tabStyle is OneNoteFlatTabs style.
Declaration
protected bool IsOneNoteStyleFlatTabs { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the TabControlAdv. This also indicates whether the theme files are referred from external assemblies or not.
Declaration
public bool IsVisualStyleEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Return true, if the visual style based theme is applied to TabControlAdv. Otherwise returns false. |
IsVS2008
Gets a value indicating whether the TabStyle is VS2008.
Declaration
protected virtual bool IsVS2008 { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsVS2010
Gets a value indicating whether this tabstyle is VS2010.
Declaration
protected virtual bool IsVS2010 { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsWhidbeyStyle
Gets a value indicating whether the tabStyle is Whidbey style.
Declaration
protected virtual bool IsWhidbeyStyle { get; }
Property Value
| Type |
|---|
| System.Boolean |
ItemSize
Gets or sets the size of the control's tabs.
Declaration
public virtual Size ItemSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Size | A Size object that represents the size of the tabs. The default automatically sizes the tabs to fit the icons and labels on the tabs. |
Remarks
To change the Width of the tab, the SizeMode property must be set to Fixed. The Height however will be set irrespective of the SizeMode.
KeepSelectedTabInFrontRow
Indicates whether the selected tab should be moved to the front row when in multiline mode.
Declaration
public virtual bool KeepSelectedTabInFrontRow { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to move to front row; false otherwise. |
LabelEdit
Indicates whether TabPage's captions are editable.
Declaration
public bool LabelEdit { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
LevelTextAndImage
Indicates whether the text and the image should be in the same level.
Declaration
public bool LevelTextAndImage { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Multiline
Indicates whether more than one row of tabs can be displayed.
Declaration
public virtual bool Multiline { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if more than one row of tabs can be displayed; false otherwise. The default is false. |
Remarks
If Multiline is false, only one row of tabs is displayed - even if all the tabs do not fit in the available space. In that case, however, scroll buttons are displayed that allow the user to navigate to the undisplayed tabs.
If the Multiline property is changed to true while the SizeMode property is set to ShrinkToFit, the SizeMode property is automatically reset to Normal.
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
MultilineText
Gets or sets indicate multiline text.
Declaration
public bool MultilineText { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
NeedLayout
Indicates whether the Layout method needs to be called to layout the TabControlAdv elements.
Declaration
protected virtual bool NeedLayout { get; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Internal method. You will not have to call or override this method explicitly.
NeedRotateTextWhenVertical
Indicates whether the Text value of the TabPageAdv needs to rotated when TabAlignment is specified as Left or Right.
Declaration
protected bool NeedRotateTextWhenVertical { get; }
Property Value
| Type |
|---|
| System.Boolean |
Office2007ColorScheme
Gets / Sets the Office2007 color scheme.
Declaration
public Office2007Theme Office2007ColorScheme { get; set; }
Property Value
| Type |
|---|
| Office2007Theme |
Office2010ColorTheme
Gets / Sets the Office2010 color scheme.
Declaration
public Office2010Theme Office2010ColorTheme { get; set; }
Property Value
| Type |
|---|
| Office2010Theme |
Padding
Gets or sets the extra space that should be added around the text or image in the tab.
Declaration
public virtual Point Padding { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Point | A Point structure representing the padding along the X and Y directions in pixels. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
PersistTabState
Gets or Sets, should Tabs state automatically persisted or not.
Declaration
public bool PersistTabState { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Renderer
Returns the current ITabPanelRenderer used by the tab control to render the tab panel.
Declaration
public ITabPanelRenderer Renderer { get; }
Property Value
| Type |
|---|
| ITabPanelRenderer |
ReservedSpace
Gets or sets the space to be reserved when no Tabs are present.
Declaration
public int ReservedSpace { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
ReserveTabSpace
Indicates whether space has been reserved for TabPage's when there are no Tab pages.
Declaration
public bool ReserveTabSpace { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
RotateTabsWhenRTL
Gets or sets should rotate tabs when RightToLeft mode is active.
Declaration
public bool RotateTabsWhenRTL { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
RotateTextWhenVertical
Indicates whether the text in the tabs should be rotated to draw horizontally when the tab strip is aligned to the left or right border.
Declaration
public virtual bool RotateTextWhenVertical { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to rotate it when aligned vertically; false otherwise. Default is false. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
ScrollButtons
Returns the ScrollButtons Control instance representing the scroll control used in the tab panel strip.
Declaration
protected ScrollButtons ScrollButtons { get; }
Property Value
| Type |
|---|
| ScrollButtons |
ScrollIncrement
Specifies whether to Scroll in tabs or pages.
Declaration
public virtual ScrollIncrement ScrollIncrement { get; set; }
Property Value
| Type | Description |
|---|---|
| ScrollIncrement | One of the ScrollIncrement values. Default is ScrollIncrement.Tab. |
SelectedIndex
Gets or sets the zero based index of the currently selected item. Returns -1 if no tabs are available.
Declaration
public virtual int SelectedIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The zero-based index of the currently-selected tab page. The default is -1, which is also the value if no tab page is selected. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
SelectedTab
Gets or sets the currently selected tab page.
Declaration
public virtual TabPageAdv SelectedTab { get; set; }
Property Value
| Type | Description |
|---|---|
| TabPageAdv | The currently-selected TabPageAdv. Default value is null. |
SeparatorColor
Gets or Sets the Color of the separator.
Declaration
public Color SeparatorColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
ShouldDrawThemed
Gets whether the control needs to drawn based on the theme appearance.
Declaration
protected bool ShouldDrawThemed { get; }
Property Value
| Type |
|---|
| System.Boolean |
ShowCloseButtonForActiveTabOnly
Gets or sets the value whether close button should be visible for tab only if mouse is over it.
This property will work only if
Declaration
public bool ShowCloseButtonForActiveTabOnly { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowCloseButtonHighLightBackColor
Gets or sets the value whether to show the close button back color when the mouse is hover on close button of Active Tab.
Declaration
public bool ShowCloseButtonHighLightBackColor { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowDefaultContextMenu
Gets or sets the value indicating whether to display context menu when the user right-clicks on a tab.
Declaration
public bool ShowDefaultContextMenu { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowScroll
Indicates whether to show or hide scroll buttons when there is not enough space for the tabs in single Line mode.
Declaration
public virtual bool ShowScroll { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if scroll buttons are needed; false otherwise. Default value is true. |
ShowSeparator
Gets/Sets the visibility of the separator.
Declaration
public bool ShowSeparator { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowSuperToolTips
Indicates whether SuperToolTips should be shown for tabs that have their tooltips set.
Declaration
public virtual bool ShowSuperToolTips { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowTabCloseButton
Gets or sets the value, whether close button should be visible for each tab.
Declaration
public bool ShowTabCloseButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowToolTips
Indicates whether tooltips should be shown for tabs that have their tooltips set.
Declaration
public virtual bool ShowToolTips { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to turn on tooltips; false otherwise. Default is false. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
SizeMode
Gets or sets the mode on how tabs are sized.
Declaration
public virtual TabSizeMode SizeMode { get; set; }
Property Value
| Type | Description |
|---|---|
| TabSizeMode | One of the TabSizeMode values. The default is Normal. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
SwitchPagesForDialogKeys
Indicates whether the Control should switch between tab pages when the user enters certain keys like Ctrl+Tab or Ctrl+Shift+Tab.
Declaration
public virtual bool SwitchPagesForDialogKeys { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to switch; false otherwise. Default is true. |
Remarks
When true, the Control will also process Up, Down, Left and Right keys (if it has focus) and the Ctrl+PageDown and Ctrl+PageUp keys to shift between the tab pages appropriately.
Ctrl+Tab and Ctrl+Page* keys will be processed by the tab control even when the focus is within one of the children in the tab pages. Also if the tab control is within an MDI Child Form, the default behavior of Ctrl+Tab keys switching the MDI child windows will be broken.
TabCount
Returns the number of tabs in the tab strip.
Declaration
public int TabCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The number of tabs in the tab strip. |
TabGap
Gets or sets the space between tabs in Single Line Mode.
Declaration
public virtual int TabGap { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The space between the tabs in pixels. Default value is zero. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
TabPages
Returns the collection of tab pages in this tab control.
Declaration
public virtual TabPageAdvCollection TabPages { get; }
Property Value
| Type | Description |
|---|---|
| TabPageAdvCollection | A TabPageAdvCollection that contains the TabPageAdv objects in this TabControlAdv. |
TabPanelBackColor
Gets or sets the background color of the tab panel and tabs. The tab's color will be overriden by individual Tab BackColor in the TabPageAdv instance, if any.
Declaration
public virtual Color TabPanelBackColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
TabPanelData
Gets or sets the value of TabPanelData.
Declaration
protected virtual TabPanelData TabPanelData { get; set; }
Property Value
| Type |
|---|
| TabPanelData |
TabPrimitivesHost
Gets the navigation control used to navigate through tabs.
Declaration
public TabPrimitivesHost TabPrimitivesHost { get; }
Property Value
| Type |
|---|
| TabPrimitivesHost |
TabStyle
Indicates whether the tabs are painted as 2D, 3D(regular), WorkbookMode or other registered tab types.
Declaration
public virtual Type TabStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Type | A reference to a type that implements the ITabRenderer interface. |
Remarks
There are 3 pre-built tab styles available, represented by the following classes in the Syncfusion.Windows.Forms.Tools namespace: TabRenderer2D (2D tabs), TabRenderer3D(3D tabs), TabRendererWorkbookMode (Workbook mode tabs).
This type-based TabStyle property allows you to implement custom tab types and plug them into the available TabStyles list of a TabControlAdv instance and specify them as the preferred TabStyle seemlessly.
Examples
The following example creates a TabControlAdv with three TabPageAdv objects. This example sets the TabStyle property to 2D which displays the tabs of the tab pages in a flat/2D appearance.
To define the dimensions of the tabs, set the ItemSize property equal to a Size structure. In this example, Size defines the tabs 90 pixels wide and 50 pixels high. You cannot change the width of the tabs unless the SizeMode property is set to Fixed.
Use the System.Drawing and Syncfusion.Windows.Forms.Tools namspaces for this example.
private void InitMyTabs()
{
this.tabControl1 = new TabControlAdv();
this.tabPage1 = new TabPageAdv();
this.tabPage2 = new TabPageAdv();
this.tabPage3 = new TabPageAdv();
// Positions tabs on the left side of tabControl1.
// this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;
// Sets the tabs to appear in 2D mode.
tabControl1.TabStyle = typeof(TabRenderer2D);
// Highlights TabPage.Text when the mouse passes over tabs.
this.tabControl1.HotTrack = true;
// Set the relative alignment between the images and text in a tab
this.tabControl1.ImageAlignmentR = RelativeImageAlignment.BelowText;
// Allows more than one row of tabs.
// this.tabControl1.Multiline = true;
// Creates a cushion of 22 pixels around TabPage.Text strings.
this.tabControl1.Padding = new System.Drawing.Point(22, 22);
// Makes the tab width definable.
this.tabControl1.SizeMode = Syncfusion.Windows.Forms.Tools.TabSizeMode.Fixed;
// Sizes the tabs of tabControl1.
this.tabControl1.ItemSize = new Size(90, 64); // Make sure to take into account the padding values.
// To rotate text when aligned vertically.
this.tabControl1.RotateTextWhenVertical = true;
// Allows the user to move the tabs by simply dragging and dropping
this.tabControl1.UserMoveTabs = true;
// Draws the scroll buttons Visual Studio MDI Tabs like.
this.tabControl1.VSLikeScrollButton = true;
this.tabControl1.Controls.AddRange(new Control[] {
this.tabPage1,
this.tabPage2,
this.tabPage3});
this.tabControl1.Location = new Point(16, 24);
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new Size(248, 232);
this.tabPage1.Text = "Tab1";
this.tabPage2.Text = "Tab2";
this.tabPage3.Text = "Tab3";
this.Size = new Size(300,300);
this.Controls.AddRange(new Control[] {
this.tabControl1});
// Selects tabPage1 using SelectedIndex.
this.tabControl1.SelectedIndex = 1;
// Shows ToolTipText when the mouse passes over tabs.
this.tabControl1.ShowToolTips = true;
}</code></pre></coderef>
Private Sub InitMyTabs()
Me.tabControl1 = New TabControlAdv()
Me.tabPage1 = New TabPageAdv()
Me.tabPage2 = New TabPageAdv()
Me.tabPage3 = New TabPageAdv()
' Positions tabs on the left side of tabControl1.
' this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;
' Sets the tabs to appear in 2D mode.
tabControl1.TabStyle = GetType(TabRenderer2D)
' Highlights TabPage.Text when the mouse passes over tabs.
Me.tabControl1.HotTrack = True
' Set the relative alignment between the images and text in a tab
Me.tabControl1.ImageAlignmentR = RelativeImageAlignment.BelowText
' Allows more than one row of tabs.
' this.tabControl1.Multiline = true;
' Creates a cushion of 22 pixels around TabPage.Text strings.
Me.tabControl1.Padding = New System.Drawing.Point(22, 22)
' Makes the tab width definable.
Me.tabControl1.SizeMode = Syncfusion.Windows.Forms.Tools.TabSizeMode.Fixed
' Sizes the tabs of tabControl1.
Me.tabControl1.ItemSize = New Size(90, 64)
' Make sure to take into account the padding values.
' To rotate text when aligned vertically.
Me.tabControl1.RotateTextWhenVertical = True
' Allows the user to move the tabs by simply dragging and dropping
Me.tabControl1.UserMoveTabs = True
' Draws the scroll buttons Visual Studio MDI Tabs like.
Me.tabControl1.VSLikeScrollButton = True
Me.tabControl1.Controls.AddRange(New Control() {Me.tabPage1, Me.tabPage2, Me.tabPage3})
Me.tabControl1.Location = New Point(16, 24)
Me.tabControl1.SelectedIndex = 0
Me.tabControl1.Size = New Size(248, 232)
Me.tabPage1.Text = "Tab1"
Me.tabPage2.Text = "Tab2"
Me.tabPage3.Text = "Tab3"
Me.Size = New Size(300, 300)
Me.Controls.AddRange(New Control() {Me.tabControl1})
' Selects tabPage1 using SelectedIndex.
Me.tabControl1.SelectedIndex = 1
' Shows ToolTipText when the mouse passes over tabs.
Me.tabControl1.ShowToolTips = True
End Sub</code></pre></coderef>
Text
Gets / Sets the Text. Overridden. See System.Windows.Forms.Control.Text.
Declaration
public override string Text { get; set; }
Property Value
| Type |
|---|
| System.String |
TextAlignment
Gets or sets the horizontal text alignment of the Tab within the layout rectangle.
Declaration
public virtual StringAlignment TextAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.StringAlignment | One of the StringAlignment values. Default is StringAlignment.Center. |
TextLineAlignment
Gets or sets the vertical line alignment of the Text in the Tab in the layout rectangle.
Declaration
public virtual StringAlignment TextLineAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.StringAlignment | One of the StringAlignment values. Default is StringAlignment.Center. |
ThemesEnabled
Indicates whether XP Themes (visual styles) should be used for this control when available.
Declaration
public bool ThemesEnabled { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
XP Themes are allowed only when Alignment is set to Top. Setting this property to true will reset the alignment to top.
Themes are also used only by the "3D" TabStyle setting.
ThemeStyle
Gets or sets the TabControlAdvVisualStyle value used to customize the appearance of the TabControlAdv.
Declaration
public TabControlAdvVisualStyle ThemeStyle { get; set; }
Property Value
| Type |
|---|
| TabControlAdvVisualStyle |
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
UseMnemonic
Gets or sets a value indicating whether the control interprets an ampersand character to be an access key prefix character.
Declaration
public bool UseMnemonic { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
UserMoveTabs
Indicates whether users can change tab position within the tab control by drag and drop.
Declaration
public virtual bool UserMoveTabs { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to allow users to move tabs; false otherwise. Default is false. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
VerticalAlignment
Indicates whether tabs are aligned to the top, bottom or based on the RightToLeft property when aligned vertically.
Declaration
public virtual TabVerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| TabVerticalAlignment | One of the TabVerticalAlignment values. The default is Default. |
Remarks
This property can be used to force the tabs to align to the top or bottom of the control irrespective of the RightToLeft setting, when aligned vertically.
VSLikeScrollButton
Indicates whether the scroll buttons should be drawn with the Visual Studio MDI child tabs like flat look.
Declaration
public bool VSLikeScrollButton { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True for VS like scroll buttons; false otherwise. Default is false. |
Examples
Take a look at TabStyle property reference for sample code on how to initialize a TabControlAdv programmatically.
Methods
AdjustNavigationCtlDimensions(ref RectangleF)
Advanced method to adjust the navigation control dimensions.
Declaration
protected virtual void AdjustNavigationCtlDimensions(ref RectangleF tabPanelBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | tabPanelBounds | A System.Drawing.RectangleF value specifying the bounds of the tabPanel. |
AdjustScrollButtonDimensions(ref RectangleF, Boolean)
Advanced method to aid customization.
Declaration
protected virtual void AdjustScrollButtonDimensions(ref RectangleF tabPanelBounds, bool scrollNeeded)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | tabPanelBounds | The tab panel bounds to be adjusted. |
| System.Boolean | scrollNeeded | True to indicate scroll buttons are needed; false otherwise. |
Remarks
The base class implementation adjusts the tab panel bounds and positions the scroll buttons appropriately.
AdjustTabPanelBounds(RectangleF)
Advanced method to aid customization.
Declaration
protected virtual RectangleF AdjustTabPanelBounds(RectangleF tabPanelBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | tabPanelBounds | The computed tab panel bounds. |
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | The adjusted tab panel bounds. |
Remarks
This method is called by ComputeTabPanelBounds() to adjust the computed tab panel bounds for custom needs. The base class implementation inserts a scroll button if necessary and also adjusts the panel bounds to accommodate this scroll button with a call to AdjustScrollButtonDimensions(ref RectangleF, Boolean).
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | scaleFactor | value to scale the factor based upon. |
BeginInit()
Declaration
protected virtual void BeginInit()
BringSelectedTabToView()
Brings the selected tab to view, if scrolled out of view.
Declaration
public void BringSelectedTabToView()
ChildControlsRemovedByDesigner(ArrayList)
Holds the child controls removed by the designer, in a arraylist.
Declaration
public void ChildControlsRemovedByDesigner(ArrayList childControls)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.ArrayList | childControls | The collection of the child controls stored in array list. |
ComputeTabPanelBounds()
Advanced method to aid customization.
Declaration
protected virtual void ComputeTabPanelBounds()
Remarks
Called by the Layout(Graphics, Boolean) method to compute the tab panel bounds.
ComputeTabPositions()
Declaration
protected void ComputeTabPositions()
ContextMenu_CloseAllButThis(Object, EventArgs)
Handles the click event of the "CloseAll ButThis" menu item
Declaration
protected void ContextMenu_CloseAllButThis(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The event source |
| System.EventArgs | e | Event date |
CreateAccessibilityInstance()
New Instance for TabControlAdv AccessibleObject
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
| Type |
|---|
| System.Windows.Forms.AccessibleObject |
CreateControlsInstance()
Overridden. See System.Windows.Forms.Control.CreateControlsInstance.
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
| Type |
|---|
| System.Windows.Forms.Control.ControlCollection |
DestroyScrollButtons(Boolean)
Destroys the scroll buttons.
Declaration
protected virtual void DestroyScrollButtons(bool multilineChanged)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | multilineChanged | True if this is called because the multiline property changed; false if called from Dispose. |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Draw3DBorder(Graphics, RectangleF)
Draws the 3D border around the tab control.
Declaration
protected virtual void Draw3DBorder(Graphics g, RectangleF borderBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | The Graphics object into which the border is drawn. |
| System.Drawing.RectangleF | borderBounds | The rectangular bounds within which the border is drawn. |
DrawAdditionalBorders(Graphics)
Draws the additional borders for Office2003 or Whidbey style.
Declaration
protected virtual void DrawAdditionalBorders(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
DrawBordersOffice2003(Graphics)
Draws the borders of office2003 tabs.
Declaration
protected void DrawBordersOffice2003(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
DrawBordersVS2005(Graphics)
Draws the borders of Whidbey style tabs.
Declaration
protected void DrawBordersVS2005(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
DrawGroupOffice2003Borders(Graphics)
Declaration
protected void DrawGroupOffice2003Borders(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
DrawMetroBorders(Graphics)
Declaration
protected void DrawMetroBorders(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
DrawPanelBackground(Graphics)
Draws the background for the tab panel.
Declaration
protected virtual void DrawPanelBackground(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | The Graphics object into which to draw. |
Remarks
This method will paint the background of the tabs and the scroll button area, if any. However, the background of the tabs will again be repainted by the corresponding ITabRenderer (corresponding to the specified tab style).
DrawVS2008Borders(Graphics)
Declaration
protected void DrawVS2008Borders(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
EndInit()
Declaration
protected virtual void EndInit()
EndLabelEdit(Boolean)
Ends the label edit.
Declaration
protected void EndLabelEdit(bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | success | End the editing process and sets the new text, if true. |
GetBorderRect()
Advanced method to aid customization.
Declaration
protected virtual RectangleF GetBorderRect()
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | The border rectangle. |
Remarks
This is the border drawn by the tab control excluding the tab panel.
GetControlName(String)
Helps to apply the ControlName settings in control
Declaration
public override string GetControlName(string controlName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | controlName |
Returns
| Type |
|---|
| System.String |
Overrides
GetRightBottomBorderColor()
Returns the Right and Bottom border color.
Declaration
protected virtual Color GetRightBottomBorderColor()
Returns
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
GetRightBottomBorderShadeColor()
Returns the Right and Bottom border shade color.
Declaration
protected virtual Color GetRightBottomBorderShadeColor()
Returns
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
GetTabPanelBounds()
Returns the current bounds of the tab panel.
Declaration
protected RectangleF GetTabPanelBounds()
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | A rectangle. |
GetTabRect(Int32)
Returns the Rectangle region of a Tab in client co-ordinates given its tab-index.
Declaration
public Rectangle GetTabRect(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The tab index of the tab. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Rectangle | A Rectangle in client co-ordinates. |
GetTopLeftBorderColor()
Returns the Top and Left border color.
Declaration
protected virtual Color GetTopLeftBorderColor()
Returns
| Type | Description |
|---|---|
| System.Drawing.Color | The Color value. |
HitTestTabs(Point)
Returns the tab at the specified location.
Declaration
public virtual int HitTestTabs(Point mousePos)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | mousePos | The point where the tab is to be found. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The hit tab's index; -1 if none found. |
HitTestTabs(Point, Boolean)
Declaration
protected virtual int HitTestTabs(Point mousePos, bool inTransformedCoOrds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | mousePos | |
| System.Boolean | inTransformedCoOrds |
Returns
| Type |
|---|
| System.Int32 |
Init()
Called by the constructor to initialize default properties of the tab control.
Declaration
protected virtual void Init()
Remarks
Advanced method. You do not have to call this directly.
InitScrollButtons()
Initializes the scroll buttons used to let user scroll the tabs.
Declaration
protected virtual void InitScrollButtons()
InvalidatePanel()
Declaration
protected void InvalidatePanel()
IsInputKey(Keys)
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Keys | keyData |
Returns
| Type |
|---|
| System.Boolean |
IsValidRendererType(Type)
Declaration
protected static bool IsValidRendererType(Type rendererType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | rendererType |
Returns
| Type |
|---|
| System.Boolean |
Layout(Graphics, Boolean)
Forces the laying out of tab control elements.
Declaration
protected virtual void Layout(Graphics g, bool fromPaint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | The Graphics object using which to calculate element sizes and positions. |
| System.Boolean | fromPaint |
Remarks
Advanced method. You do not have to call this directly.
LoadState()
Loads the tab state from persistent storage medium.
Declaration
public virtual void LoadState()
LoadState(AppStateSerializer)
Reads a previously serialized tabState using the AppStateSerializer object.
Declaration
public virtual void LoadState(AppStateSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| AppStateSerializer | serializer | A reference to the AppStateSerializer instance. |
Remarks
Reads the tabstate information from the specified persistent store and applies the new state.
Examples
//Loading TabState from xml file(TabState.xml located in Application folder)
AppStateSerializer serializer = new AppStateSerializer(SerializeMode.XMLFile, "TabState");
this.tabControlAdv1.LoadState(serializer);
'Loading TabState from xml file(TabState.xml located in Application folder)
Dim serializer As New AppStateSerializer(SerializeMode.XMLFile, "TabState")
Me.tabControlAdv1.LoadState(serializer)
OnAfterEdit(EditEventArgs)
Declaration
protected virtual void OnAfterEdit(EditEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EditEventArgs | e |
OnBeforeEdit(EditEventArgs)
Declaration
protected virtual void OnBeforeEdit(EditEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EditEventArgs | e |
OnCanApplyThemeChanged(Boolean)
Helps to apply the CanApplyTheme settings in control
Declaration
public override void OnCanApplyThemeChanged(bool canApplyTheme)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | canApplyTheme |
Overrides
OnCanOverrideStyleChanged(Boolean)
Helps to apply the CanOverriderStyle settings in control
Declaration
public override void OnCanOverrideStyleChanged(bool canOverriderStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | canOverriderStyle |
Overrides
OnDockChanged(EventArgs)
Declaration
protected override void OnDockChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnDrawItem(DrawTabEventArgs)
Raises the DrawItem event.
Declaration
public virtual bool OnDrawItem(DrawTabEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| DrawTabEventArgs | eventArgs | A DrawItemEventArgs that contains the event data. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if there were listeners; false otherwise. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnDrawItem method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnDrawItem in a derived class, be sure to call the base class's OnDrawItem method so that registered delegates receive the event.
OnEnter(EventArgs)
Declaration
protected override void OnEnter(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnFontChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnFontChanged(System.EventArgs).
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnGotFocus(EventArgs)
Overridden. See System.Windows.Forms.Control.OnGotFocus(System.EventArgs).
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An EventArgs that contains the event data. |
OnHandleCreated(EventArgs)
Overridden. See System.Windows.Forms.Control.OnHandleCreated(System.EventArgs).
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnKeyDown(KeyEventArgs)
Overridden. See System.Windows.Forms.Control.OnKeyDown(System.Windows.Forms.KeyEventArgs).
Declaration
protected override void OnKeyDown(KeyEventArgs ke)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.KeyEventArgs | ke | A KeyEventArgs that contains the event data. |
OnKeyUp(KeyEventArgs)
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.KeyEventArgs | e |
OnLabelEdit()
Overridden LabelEdit
Declaration
protected virtual void OnLabelEdit()
OnLabelEditTextChanged()
Declaration
protected virtual void OnLabelEditTextChanged()
OnLayout(LayoutEventArgs)
Overridden. See System.Windows.Forms.Control.OnLayout(System.Windows.Forms.LayoutEventArgs).
Declaration
protected override void OnLayout(LayoutEventArgs levent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.LayoutEventArgs | levent | A LayoutEventArgs that contains the event data. |
OnLeave(EventArgs)
Declaration
protected override void OnLeave(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnLostFocus(EventArgs)
Overridden. See System.Windows.Forms.Control.OnLostFocus(System.EventArgs).
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An EventArgs that contains the event data. |
OnMouseDown(MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnMouseEnter(EventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseEnter(System.EventArgs).
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseHover(EventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseHover(System.EventArgs).
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseLeave(EventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseLeave(System.EventArgs).
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseMove(MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnMouseUp(MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnPaint(PaintEventArgs)
Overridden. See System.Windows.Forms.Control.OnPaint(System.Windows.Forms.PaintEventArgs).
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | e |
OnRightToLeftChanged(EventArgs)
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnSelectedIndexChanged(EventArgs)
Raises the SelectedIndexChanged event.
Declaration
protected virtual void OnSelectedIndexChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnSelectedIndexChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnSelectedIndexChanged in a derived class, be sure to call the base class's OnSelectedIndexChanged method so that registered delegates receive the event.
OnSelectedIndexChanging(SelectedIndexChangingEventArgs)
Raises the SelectedIndexChanging event.
Declaration
protected virtual void OnSelectedIndexChanging(SelectedIndexChangingEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectedIndexChangingEventArgs | e | An SelectedIndexChanging instance that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnSelectedIndexChanging method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnSelectedIndexChanging in a derived class, be sure to call the base class's OnSelectedIndexChanging method so that registered delegates receive the event.
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnStyleChanged()
Called when the tabStyle is changed.
Declaration
protected virtual void OnStyleChanged()
OnSystemColorsChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnSystemColorsChanged(System.EventArgs).
Declaration
protected override void OnSystemColorsChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An EventArgs that contains the event data. |
OnTabMoving(TabMovingEventArgs)
Raises the TabMoving event.
Declaration
public virtual void OnTabMoving(TabMovingEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TabMovingEventArgs | e | The TabMovingEventArgs instance containing the event data. |
OnTabPanelBoundsAffected()
Forces the tab control to re-layout its elements.
Declaration
public virtual void OnTabPanelBoundsAffected()
Remarks
Advanced method. Need not be called under normal usage scenarios.
OnTabPrimitiveClick(TabPrimitiveClickEventArgs)
Raises the NavigationButtonClick event.
Declaration
protected virtual void OnTabPrimitiveClick(TabPrimitiveClickEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TabPrimitiveClickEventArgs | e |
OnTabsOrderChanged()
Raises the TabsOrderChanged event.
Declaration
public virtual void OnTabsOrderChanged()
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | themeName | ThemeName |
Overrides
OnVisibleChanged(EventArgs)
Declaration
protected override void OnVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
ProcessCmdKey(ref Message, Keys)
Declaration
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | msg | |
| System.Windows.Forms.Keys | keyData |
Returns
| Type |
|---|
| System.Boolean |
ProcessKeyPreview(ref Message)
Overridden. See System.Windows.Forms.Control.ProcessKeyPreview(System.Windows.Forms.Message@).
Declaration
protected override bool ProcessKeyPreview(ref Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m |
Returns
| Type |
|---|
| System.Boolean |
ProcessMnemonic(Char)
Declaration
protected override bool ProcessMnemonic(char charCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char | charCode |
Returns
| Type |
|---|
| System.Boolean |
RaiseAfterEdit(EditEventArgs)
Raises the AfterEdit event.
Declaration
protected void RaiseAfterEdit(EditEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EditEventArgs | e | The EditEventArgs instance containing the event data. |
RaiseBeforeEdit(EditEventArgs)
Raises the BeforeEdit event.
Declaration
protected void RaiseBeforeEdit(EditEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EditEventArgs | e | The EditEventArgs instance containing the event data. |
RaiseLabelEditChanged()
Raises the LabelEditChanged event.
Declaration
protected void RaiseLabelEditChanged()
RaiseLabelEditTextChanged()
Raises the LabelEditTextChanged event.
Declaration
protected void RaiseLabelEditTextChanged()
RaiseTabMoving(TabMovingEventArgs)
Raises the tab moving.
Declaration
protected void RaiseTabMoving(TabMovingEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TabMovingEventArgs | e | The TabMovingEventArgs instance containing the event data. |
RaiseTabsOrderChanged()
Raises the TabsOrderChanged event.
Declaration
protected void RaiseTabsOrderChanged()
RemoveAll()
Removes all the tab pages and additional controls from this tab control.
Declaration
public void RemoveAll()
Remarks
All controls are removed through the Controls property.
RendererChanged(TabPanelRenderer)
Advanced method to aid customization.
Declaration
protected virtual void RendererChanged(TabPanelRenderer rendererNew)
Parameters
| Type | Name | Description |
|---|---|---|
| TabPanelRenderer | rendererNew | The new tab panel renderer. |
Remarks
This method is called when the Multiline property is toggled. Internally, a different ITabPanelRenderer is used to render the multiline mode and the singleline mode. You can override this method and provide a custom renderer or modify the existing renderer based on the current Multiline setting.
ResetActiveTabColor()
Resets the ActiveTabColor property to its default value.
Declaration
public virtual void ResetActiveTabColor()
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ResetActiveTabFont()
Resets the ActiveTabFont property to its default value.
Declaration
public virtual void ResetActiveTabFont()
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ResetBorderColor()
Resets BorderColor to its default value.
Declaration
public virtual void ResetBorderColor()
ResetCloseButtonForeColor()
Resets the CloseButtonForeColor property to its default value.
Declaration
public virtual void ResetCloseButtonForeColor()
ResetCloseButtonHoverForeColor()
Resets the CloseButtonHoverForeColor property to its default value.
Declaration
public virtual void ResetCloseButtonHoverForeColor()
ResetCloseButtonPressedForeColor()
Resets the CloseButtonPressedForeColor property to its default value.
Declaration
public virtual void ResetCloseButtonPressedForeColor()
ResetFixedSingleBorderColor()
Resets the fixed single border color to it's default value.
Declaration
public void ResetFixedSingleBorderColor()
ResetFont()
Overridden. See System.Windows.Forms.Control.ResetFont.
Declaration
public override void ResetFont()
ResetInactiveCloseButtonForeColor()
Resets the InactiveCloseButtonForeColor property to its default value.
Declaration
public virtual void ResetInactiveCloseButtonForeColor()
ResetInactiveTabColor()
Resets the InactiveTabColor property to its default value.
Declaration
public virtual void ResetInactiveTabColor()
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ResetItemSize()
Resets the ItemSize property to its default value.
Declaration
public virtual void ResetItemSize()
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ResetTabPanelBackColor()
Resets the TabPanelBackColor property to its default value.
Declaration
public virtual void ResetTabPanelBackColor()
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
SaveState()
Saves the tab state to Isolated Storage.
Declaration
public virtual void SaveState()
SaveState(AppStateSerializer)
Saves the current tab state information to the specified AppStateSerializer.
Declaration
public virtual void SaveState(AppStateSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| AppStateSerializer | serializer | A reference to the AppStateSerializer instance. |
Remarks
Writes the tab state information like Active TabPage, TabOrder and New Text using Label Edit to the persistence medium.
Examples
//Saving TabState to xml file(TabState.xml located in Application folder)
AppStateSerializer serializer =new AppStateSerializer(SerializeMode.XMLFile, "TabState");
this.tabControlAdv1.SaveState(serializer);
serializer.PersistNow();
'Saving TabState to xml file(TabState.xml located in Application folder)
Dim serializer As New AppStateSerializer(SerializeMode.XMLFile, "TabState")
Me.tabControlAdv1.SaveState(serializer)
serializer.PersistNow()
SetNeedLayout(Boolean)
Forces the laying out of tab control elements within the next Paint Message handler.
Declaration
protected void SetNeedLayout(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | value | True to force; false to prevent layout. |
SetRegion()
Sets region of the control
Declaration
protected virtual void SetRegion()
SetTabPanelBounds(RectangleF)
Sets the bounds for the tab panel.
Declaration
protected virtual void SetTabPanelBounds(RectangleF tabPanelBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | tabPanelBounds | The new bounds of the tab panel. |
Remarks
Override this method and provide a new rectangle to set a custom bounds for the tab panel.
ShouldDrawCloseButton(Int32)
Indicates whether the close button should be visible accordingly to the ShowCloseButtonForActiveTabOnly property.
Declaration
protected bool ShouldDrawCloseButton(int pTabIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pTabIndex |
Returns
| Type |
|---|
| System.Boolean |
ShouldDrawCloseButton(Int32, Boolean)
Indicates whether the close button should be visible accordingly to the ShowCloseButtonForActiveTabOnly property.
Declaration
protected bool ShouldDrawCloseButton(int pTabIndex, bool close)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pTabIndex | |
| System.Boolean | close |
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeActiveTabColor()
Indicates whether the current value of the ActiveTabColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeActiveTabColor()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializeActiveTabFont()
Indicates whether the current value of the ActiveTabFont property is to be serialized.
Declaration
protected virtual bool ShouldSerializeActiveTabFont()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializeBorderColor()
Declaration
protected virtual bool ShouldSerializeBorderColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeCloseButtonBackColor()
Declaration
protected virtual bool ShouldSerializeCloseButtonBackColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeCloseButtonForeColor()
Indicates whether the current value of the CloseButtonForeColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeCloseButtonForeColor()
Returns
| Type | Description |
|---|---|
| System.Boolean | The value of the CloseButtonForeColor |
ShouldSerializeCloseButtonHoverForeColor()
Indicates whether the current value of the CloseButtonHoverForeColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeCloseButtonHoverForeColor()
Returns
| Type | Description |
|---|---|
| System.Boolean | The value of the CloseButtonHoverForeColor |
ShouldSerializeCloseButtonPressedForeColor()
Indicates whether the current value of the CloseButtonPressedForeColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeCloseButtonPressedForeColor()
Returns
| Type | Description |
|---|---|
| System.Boolean | The value of the CloseButtonPressedForeColor |
ShouldSerializeFixedSingleBorderColor()
Specifies a value indicating whether fixed single border color need to be serialized.
Declaration
public bool ShouldSerializeFixedSingleBorderColor()
Returns
| Type | Description |
|---|---|
| System.Boolean | The FixedSingleBorderColor. |
ShouldSerializeInactiveCloseButtonForeColor()
Indicates whether the current value of the InactiveCloseButtonForeColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeInactiveCloseButtonForeColor()
Returns
| Type | Description |
|---|---|
| System.Boolean | The value of the InactiveCloseButtonForeColor. |
ShouldSerializeInactiveTabColor()
Indicates whether the current value of the ActiveTabColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeInactiveTabColor()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializeItemSize()
Indicates whether the current value of the ItemSize property is to be serialized.
Declaration
protected virtual bool ShouldSerializeItemSize()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializePadding()
Indicates whether he current value of the Padding property is to be serialized.
Declaration
protected virtual bool ShouldSerializePadding()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializeShowCloseButtonHighLightBackColor()
Declaration
protected virtual bool ShouldSerializeShowCloseButtonHighLightBackColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeTabPanelBackColor()
Indicates whether the current value of the TabPanelBackColor property is to be serialized.
Declaration
protected virtual bool ShouldSerializeTabPanelBackColor()
Returns
| Type |
|---|
| System.Boolean |
Remarks
You typically use this method if you are either creating a designer for the Control or creating your own control incorporating this Control.
ShouldSerializeTextAlignment()
Declaration
protected virtual bool ShouldSerializeTextAlignment()
Returns
| Type |
|---|
| System.Boolean |
StartLabelEdit()
Begins the label edit process.
Declaration
protected void StartLabelEdit()
ToString()
Overridden. See System.Object.ToString().
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The string representation of the Control. |
UpdateScrollButtonsStyle()
Declaration
protected void UpdateScrollButtonsStyle()
UpdateScrollButtonState()
Declaration
protected void UpdateScrollButtonState()
UpdateSelectedTabPage(Boolean)
Advanced method to aid customization.
Declaration
protected virtual void UpdateSelectedTabPage(bool setBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | setBounds | Indicates whether the bounds should also be set on the tab page. |
Remarks
This method is called from Layout(Graphics, Boolean)to ensure that the current tab page is valid and is the requested tab.
Sometimes bounds should not be set on the tab pages as the tab control might not have been created at this point.
UpDownEventHandler(Object, UpDownEventArgs)
Declaration
protected void UpDownEventHandler(object source, UpDownEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | |
| System.Windows.Forms.UpDownEventArgs | e |
ValidateFocusedTab()
Calls the System.Windows.Forms.ContainerControl.Validate method on the parent container control.
Declaration
public virtual bool ValidateFocusedTab()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if validation was successful; false otherwise. |
ValidateSelectedIndex()
Validates that the currently selected tab is not disabled or invisible.
Declaration
public void ValidateSelectedIndex()
Remarks
This method ensures that the currently selected tab is not disabled or invisible. If so, it would reset the SelectedIndex to a new tab page that is selectable. If no selectable tab pages are found, then this method will do nothing.
WndProc(ref Message)
Overridden. See System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
Declaration
protected override void WndProc(ref Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m |
Events
AfterEdit
Occurs after Editing TabPage's Caption editing.
Declaration
public event EditEventHandler AfterEdit
Event Type
| Type |
|---|
| EditEventHandler |
BeforeEdit
Occurs before Editing TabPage's Caption editing.
Declaration
public event EditEventHandler BeforeEdit
Event Type
| Type |
|---|
| EditEventHandler |
DrawItem
Occurs when the tabs are drawn.
Declaration
public event DrawTabEventHandler DrawItem
Event Type
| Type | Description |
|---|---|
| DrawTabEventHandler | The event handler receives an argument of type DrawTabEventArgs containing data related to this event. Take a look at the DrawTabEventArgs class reference for information on the data passed to this event handler. |
Remarks
In this event handler, you can take over drawing of the whole tab or draw portions of the tab while delegating the rest to the default drawing logic.
A tab's default drawing logic is exposed in the DrawTabEventArgs args. The default drawing logic is classified as drawing the background, interiors and borders. You can call the corresponding DrawBackground, DrawInterior, DrawBorders methods in the DrawTabEventArgs class to use the default painting logic. The example below illustrates this logic.
Examples
The following example customizes tab drawing to create a Yahoo-Messenger like tab panel. It uses just the tab's default drawing logic to obtain this effect.
// Make sure to set the "3D" tab style, turn on the HotTrack property and handle
// the DrawItem event of the tab control.
private void InitializeComponent()
{
....
this.TabControlAdv1.HotTrack = true;
this.TabControlAdv1.TabStyle = typeof(Syncfusion.Windows.Forms.Tools.TabRenderer3D);
this.TabControlAdv1.DrawItem += new Syncfusion.Windows.Forms.Tools.DrawTabEventHandler(this.Tab_DrawItemYahooMessengerLike);
....
}
private void Tab_DrawItemYahooMessengerLike(object sender, DrawTabEventArgs drawItemInfo)
{
// Draw the default background and interior in all cases.
drawItemInfo.DrawBackground();
drawItemInfo.DrawInterior();
// The border should be drawn only when the item is selected or highlighted.
if(((int)drawItemInfo.State & ((int)DrawItemState.Selected | (int)DrawItemState.HotLight)) > 0)
{
// Draw the borders
drawItemInfo.DrawBorders();
}
}
' Make sure to set the "3D" tab style, turn on the HotTrack property and handle
' the DrawItem event of the tab control.
Private Sub InitializeComponent()
Me.TabControlAdv1.HotTrack = True
Me.TabControlAdv1.TabStyle = GetType(Syncfusion.Windows.Forms.Tools.TabRenderer3D)
Me.TabControlAdv1.DrawItem += New Syncfusion.Windows.Forms.Tools.DrawTabEventHandler(Me.Tab_DrawItemYahooMessengerLike)
End Sub 'InitializeComponent
Private Sub Tab_DrawItemYahooMessengerLike(sender As Object, drawItemInfo As DrawTabEventArgs)
' Draw the default background and interior in all cases.
drawItemInfo.DrawBackground()
drawItemInfo.DrawInterior()
' The border should be drawn only when the item is selected or highlighted.
If(CInt(drawItemInfo.State) And(CInt(DrawItemState.Selected) Or CInt(DrawItemState.HotLight))) > 0 Then
' Draw the borders
drawItemInfo.DrawBorders()
End If
End Sub 'Tab_DrawItemYahooMessengerLike
HotTracked
Occurs on HotTracking TabPageAdv
Declaration
public event HotTrackedEventHandler HotTracked
Event Type
| Type |
|---|
| HotTrackedEventHandler |
LabelEditChanged
Occurs when the LabelEdit property is changed.
Declaration
public event EventHandler LabelEditChanged
Event Type
| Type |
|---|
| System.EventHandler |
LabelEditTextChanged
Occurs when the LabelEdit TabPage Caption is changed.
Declaration
public event EventHandler LabelEditTextChanged
Event Type
| Type |
|---|
| System.EventHandler |
SelectedIndexChanged
Occurs when the SelectedIndex property is changed.
Declaration
public event EventHandler SelectedIndexChanged
Event Type
| Type |
|---|
| System.EventHandler |
SelectedIndexChanging
Occurs before the SelectedIndex property gets changed to let you cancel the new selection.
Declaration
public event SelectedIndexChangingEventHandler SelectedIndexChanging
Event Type
| Type |
|---|
| SelectedIndexChangingEventHandler |
TabMoving
Occurs on moving TabPage
Declaration
public event TabMovingEventHandler TabMoving
Event Type
| Type |
|---|
| TabMovingEventHandler |
TabPrimitiveClick
Occurs before navigation button click.
Declaration
public event TabPrimitiveClick TabPrimitiveClick
Event Type
| Type |
|---|
| TabPrimitiveClick |
TabsOrderChanged
Occurs when the order of tabs is changed.
Declaration
public event EventHandler TabsOrderChanged
Event Type
| Type |
|---|
| System.EventHandler |
Explicit Interface Implementations
ISupportOffice2007Theme.EnableOffice2007Style()
Declaration
void ISupportOffice2007Theme.EnableOffice2007Style()
ISupportOffice2007Theme.Office2007ColorTheme
Declaration
Office2007Theme ISupportOffice2007Theme.Office2007ColorTheme { get; set; }
Returns
| Type |
|---|
| Office2007Theme |
ITabControl.get_ClientRectangle()
Declaration
Rectangle ITabControl.get_ClientRectangle()
Returns
| Type |
|---|
| System.Drawing.Rectangle |
ITabControl.GetControl()
Declaration
Control ITabControl.GetControl()
Returns
| Type |
|---|
| System.Windows.Forms.Control |
ITabControl.GetGraphics()
Declaration
Graphics ITabControl.GetGraphics()
Returns
| Type |
|---|
| System.Drawing.Graphics |
ITabControl.IsDesignMode()
Declaration
bool ITabControl.IsDesignMode()
Returns
| Type |
|---|
| System.Boolean |
ITabControl.OnRepaint(RectangleF)
Declaration
void ITabControl.OnRepaint(RectangleF affectedRect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | affectedRect |
ITabControl.OnScrollPositionChanged()
Declaration
void ITabControl.OnScrollPositionChanged()
ITabControl.ThemedDrawing
Declaration
ThemedTabDrawing ITabControl.ThemedDrawing { get; }
Returns
| Type |
|---|
| ThemedTabDrawing |
ITabControl.ThemesEnabled
Declaration
bool ITabControl.ThemesEnabled { get; }
Returns
| Type |
|---|
| System.Boolean |