menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TabBar - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TabBar

    A control for creating Tabbed Dialogs or Excel workbook type windows. This control provides a row of tabs that the user can select from one at a time. After each selection, a notification is provided that allows for changing of UI. The tab bar can share the row with an associated scrollbar. The user can adjust the width of the tab bar and increase the scrollbar's size by dragging a splitter found in the middle of the row.

    Inheritance
    System.Object
    ButtonBar
    ArrowButtonBar
    TabBar
    Implements
    IControlToolTipProvider
    ICancelModeProvider
    ISupportUpdating
    IThemedControl
    IScrollBarContainer
    Inherited Members
    ArrowButtonBar.AllArrowButtons
    ArrowButtonBar.ArrowButtonChanged
    ArrowButtonBar.ArrowButtonClicked
    ArrowButtonBar.DisabledColor
    ArrowButtonBar.EnableButtonFlags
    ArrowButtonBar.EnabledColor
    ArrowButtonBar.InitBars()
    ArrowButtonBar.MinRepeatClickDelay
    ArrowButtonBar.NoArrowButtons
    ArrowButtonBar.OnArrowButtonClicked(ArrowButtonEventArgs)
    ArrowButtonBar.OnCreateButtonBarChild()
    ArrowButtonBar.OnThemeChanged(EventArgs)
    ArrowButtonBar.RepeatClickDelay
    ArrowButtonBar.ResetDisabledColor()
    ArrowButtonBar.ResetEnabledColor()
    ArrowButtonBar.SingleArrowButtons
    ArrowButtonBar.ThemeChanged
    ArrowButtonBar.ThemesEnabled
    ButtonBar.BeginUpdate()
    ButtonBar.ButtonBarChild
    ButtonBar.ButtonBarMouseDown
    ButtonBar.ButtonLook
    ButtonBar.ButtonLookChanged
    ButtonBar.CancelMode
    ButtonBar.DefaultSize
    ButtonBar.EndUpdate()
    ButtonBar.EndUpdate(Boolean)
    ButtonBar.IControlToolTipProvider.GetControlToolTip()
    ButtonBar.ISupportUpdating.Updating
    ButtonBar.OnButtonBarMouseDown(MouseEventArgs)
    ButtonBar.OnHandleDestroyed(EventArgs)
    ButtonBar.Updating
    Namespace: Syncfusion.Windows.Forms
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class TabBar : ArrowButtonBar, IControlToolTipProvider, ICancelModeProvider, ISupportUpdating, IInternalArrowButtonParent, IInternalTabParent, IInternalTabBarParent, IInternalButtonParent, IThemedControl, IInternalSplitterParent, IScrollBarContainer

    Constructors

    TabBar()

    Initializes a new TabBar.

    Declaration
    public TabBar()

    TabBar(Control)

    Initializes a new TabBar with a scrollbar.

    Declaration
    public TabBar(Control scrollBar)
    Parameters
    Type Name Description
    System.Windows.Forms.Control scrollBar

    The scrollbar to be displayed to the right of the tab bar.

    Fields

    m_AddButtonImage

    Declaration
    public Image m_AddButtonImage
    Field Value
    Type
    System.Drawing.Image

    m_LeftSpacerChild

    Declaration
    public InternalSpacer m_LeftSpacerChild
    Field Value
    Type
    Syncfusion.Windows.Forms.InternalSpacer

    m_RightSpacerChild

    Declaration
    public InternalSpacer m_RightSpacerChild
    Field Value
    Type
    Syncfusion.Windows.Forms.InternalSpacer

    Properties

    AddButtonHoverColor

    Gets/Sets the Hover color for AddButton.

    Declaration
    public Color AddButtonHoverColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    AddButtonImage

    Gets/Sets AddNewTabBarOption Image in TabBarSplitterControl

    Declaration
    public Image AddButtonImage { get; set; }
    Property Value
    Type
    System.Drawing.Image

    CreateParams

    Declaration
    protected override CreateParams CreateParams { get; }
    Property Value
    Type
    System.Windows.Forms.CreateParams

    DisplayArrowButtons

    Declaration
    public override DisplayArrowButtons DisplayArrowButtons { get; set; }
    Property Value
    Type
    DisplayArrowButtons
    Overrides
    ArrowButtonBar.DisplayArrowButtons

    EditOnTabPage

    Enable the edit mode in TabBarPage

    Declaration
    public bool EditOnTabPage { get; set; }
    Property Value
    Type
    System.Boolean

    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

    HoveredTabBarPage

    Gets/Sets TabBarPage which is being mouse pointed

    Declaration
    public TabBarPage HoveredTabBarPage { get; set; }
    Property Value
    Type
    TabBarPage

    ImageList

    Returns the imageList the control points at. This is where tabs that have imageIndex set will get their images from.

    Declaration
    public ImageList ImageList { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.ImageList

    An image list control.

    LeftSpacerChild

    Gets or sets a LeftSpacerChild that holds an array of buttons.

    Declaration
    public InternalSpacer LeftSpacerChild { get; set; }
    Property Value
    Type
    Syncfusion.Windows.Forms.InternalSpacer

    Office2007ColorScheme

    Gets or sets office 2007 color scheme.

    Declaration
    public Office2007Theme Office2007ColorScheme { get; set; }
    Property Value
    Type
    Office2007Theme

    RelativeWidth

    Gets / sets the width of the tab bar relative to the width of the client bounds.

    Declaration
    public int RelativeWidth { get; set; }
    Property Value
    Type
    System.Int32

    Resizable

    Enables / disables the resizing of tab bar.

    Declaration
    public bool Resizable { get; set; }
    Property Value
    Type
    System.Boolean

    RightSpacerChild

    Gets or sets a LeftSpacerChild that holds an array of buttons.

    Declaration
    public InternalSpacer RightSpacerChild { get; set; }
    Property Value
    Type
    Syncfusion.Windows.Forms.InternalSpacer

    ScrollBehavior

    Gets / sets the scroll behavior of this tab bar: pixel or tabs.

    Declaration
    public InternalTabBarScrollBehavior ScrollBehavior { get; set; }
    Property Value
    Type
    Syncfusion.Windows.Forms.InternalTabBarScrollBehavior

    SelectedIndex

    Gets / sets the index of the currently selected tab in the strip, if there is one. If the value is -1, there is currently no selection. If the value is 0 or greater, then the value is the index of the currently selected tab.

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type
    System.Int32

    SelectedItem

    Gets / sets the cookie of the current selected tab or sets the tab with the specified cookie.

    Declaration
    public object SelectedItem { get; set; }
    Property Value
    Type
    System.Object

    ShowAddNewOption

    Gets/Sets whether to show/hide AddNewButton Image

    Declaration
    public bool ShowAddNewOption { get; set; }
    Property Value
    Type
    System.Boolean

    ShowToolTips

    Indicates whether ToolTips are being shown for tabs that have ToolTips set on them.

    Declaration
    public bool ShowToolTips { get; set; }
    Property Value
    Type
    System.Boolean

    Site

    Declaration
    public override ISite Site { get; set; }
    Property Value
    Type
    System.ComponentModel.ISite

    Style

    Gets or sets the visual style of the tabBar.

    Declaration
    public TabBarSplitterStyle Style { get; set; }
    Property Value
    Type
    TabBarSplitterStyle

    TabBarChild

    Gets / sets the inner tab bar that displays the tabs.

    Declaration
    public InternalTabBar TabBarChild { get; set; }
    Property Value
    Type
    Syncfusion.Windows.Forms.InternalTabBar

    TabCount

    Returns the number of tabs in the strip.

    Declaration
    public int TabCount { get; }
    Property Value
    Type
    System.Int32

    TabFolderDelta

    Gets / sets the delta used for drawing the tabs.

    Declaration
    public int TabFolderDelta { get; set; }
    Property Value
    Type
    System.Int32

    Tabs

    Returns the list of tabs displayed in the tab bar.

    Declaration
    public InternalTabCollection Tabs { get; }
    Property Value
    Type
    Syncfusion.Windows.Forms.InternalTabCollection

    Text

    Declaration
    public override string Text { get; set; }
    Property Value
    Type
    System.String

    ThemeName

    Gets or sets the visual style of the tabBar.

    Declaration
    public string ThemeName { get; set; }
    Property Value
    Type
    System.String

    Methods

    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.

    ComputeButtonBarChildBounds()

    Calculates the boundaries of the arrow bar within the current control.

    Declaration
    protected override Rectangle ComputeButtonBarChildBounds()
    Returns
    Type Description
    System.Drawing.Rectangle

    The boundaries of the arrow bar.

    Overrides
    ButtonBar.ComputeButtonBarChildBounds()

    ComputeTabBarBounds()

    Calculates the boundaries of the tab bar (both tabs and arrows) within the current control.

    Declaration
    protected virtual Rectangle ComputeTabBarBounds()
    Returns
    Type Description
    System.Drawing.Rectangle

    The boundaries of the tab bar.

    Remarks

    Will return System.Windows.Forms.Control.ClientRectangle unless overriden in derived class.

    ComputeTabBarChildBounds(Rectangle)

    Calculates the boundaries of the tab bar child (without arrow bar) within the current control.

    Declaration
    protected virtual Rectangle ComputeTabBarChildBounds(Rectangle buttonBarRect)
    Parameters
    Type Name Description
    System.Drawing.Rectangle buttonBarRect

    The size of the tab bar.

    Returns
    Type Description
    System.Drawing.Rectangle

    The boundaries of the inner tab bar.

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    ButtonBar.Dispose(Boolean)

    FindItem(Object)

    Finds and returns the tab that holds the specified item as cookie.

    Declaration
    public int FindItem(object item)
    Parameters
    Type Name Description
    System.Object item
    Returns
    Type
    System.Int32

    InvalidateSplitter(Object)

    Repaints the splitter bar.

    Declaration
    public virtual void InvalidateSplitter(object sender)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    OnButtonLookChanged(EventArgs)

    Declaration
    protected override void OnButtonLookChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e
    Overrides
    ButtonBar.OnButtonLookChanged(EventArgs)

    OnCancelMode(EventArgs)

    Declaration
    protected override void OnCancelMode(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e
    Overrides
    ButtonBar.OnCancelMode(EventArgs)

    OnCreateTabBarChild()

    Creates the inner tab bar that displays the tabs.

    Declaration
    protected virtual InternalTabBar OnCreateTabBarChild()
    Returns
    Type Description
    Syncfusion.Windows.Forms.InternalTabBar

    The Syncfusion.Windows.Forms.InternalTabBar for the inner tabs.

    OnDoubleClick(EventArgs)

    Declaration
    protected override void OnDoubleClick(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnDraggingTab(TabMovedEventArgs)

    Raises the DraggingTab event.

    Declaration
    protected virtual void OnDraggingTab(TabMovedEventArgs e)
    Parameters
    Type Name Description
    TabMovedEventArgs e

    A TabMovedEventArgs that contains the event data.

    OnFontChanged(EventArgs)

    Declaration
    protected override void OnFontChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e
    Overrides
    ButtonBar.OnFontChanged(EventArgs)

    OnHandleCreated(EventArgs)

    Declaration
    protected override void OnHandleCreated(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnImageListChanged(EventArgs)

    Raises the ImageListChanged event.

    Declaration
    protected virtual void OnImageListChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    A System.EventArgs that contains the event data.

    OnKeyDown(KeyEventArgs)

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.KeyEventArgs e

    OnLayout(LayoutEventArgs)

    Declaration
    protected override void OnLayout(LayoutEventArgs levent)
    Parameters
    Type Name Description
    System.Windows.Forms.LayoutEventArgs levent
    Overrides
    ButtonBar.OnLayout(LayoutEventArgs)

    OnMouseDown(MouseEventArgs)

    Declaration
    protected override void OnMouseDown(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e
    Overrides
    ButtonBar.OnMouseDown(MouseEventArgs)

    OnMouseEnter(EventArgs)

    Declaration
    protected override void OnMouseEnter(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseLeave(EventArgs)

    Declaration
    protected override void OnMouseLeave(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseMove(MouseEventArgs)

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnMouseUp(MouseEventArgs)

    Declaration
    protected override void OnMouseUp(MouseEventArgs mevent)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs mevent
    Overrides
    ButtonBar.OnMouseUp(MouseEventArgs)

    OnMovedSplitter(Object)

    Occurs after the user moved the splitter bar.

    Declaration
    public virtual void OnMovedSplitter(object sender)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    OnMoveSplitter(Object, Int32, Int32)

    Occurs when the users drags the splitbar.

    Declaration
    public virtual void OnMoveSplitter(object sender, int x, int y)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    System.Int32 x

    The current horizontal position in pixels.

    System.Int32 y

    The current vertical position in pixels.

    OnPaint(PaintEventArgs)

    Declaration
    protected override void OnPaint(PaintEventArgs pe)
    Parameters
    Type Name Description
    System.Windows.Forms.PaintEventArgs pe
    Overrides
    ButtonBar.OnPaint(PaintEventArgs)

    OnRelativeWidthChanged(EventArgs)

    Raises the RelativeWidthChanged event.

    Declaration
    protected virtual void OnRelativeWidthChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    Event data.

    OnSetCursor(ref Message)

    Declaration
    protected virtual void OnSetCursor(ref Message m)
    Parameters
    Type Name Description
    System.Windows.Forms.Message m

    OnSizeChanged(EventArgs)

    Declaration
    protected override void OnSizeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnStyleChanged()

    Declaration
    protected virtual void OnStyleChanged()

    RaiseSelectedIndexChangedEvent(SelectedIndexEventArgs)

    Declaration
    protected void RaiseSelectedIndexChangedEvent(SelectedIndexEventArgs e)
    Parameters
    Type Name Description
    SelectedIndexEventArgs e

    RaiseSelectedIndexChangingEvent(SelectedIndexEventArgs)

    Declaration
    protected void RaiseSelectedIndexChangingEvent(SelectedIndexEventArgs e)
    Parameters
    Type Name Description
    SelectedIndexEventArgs e

    Refresh()

    Declaration
    public override void Refresh()
    Overrides
    ButtonBar.Refresh()

    RemoveAll()

    Removes all tabs.

    Declaration
    protected void RemoveAll()

    RemoveItem(Object)

    Removes the tab that holds the specified item as cookie.

    Declaration
    public void RemoveItem(object item)
    Parameters
    Type Name Description
    System.Object item

    ResetAddButtonHoverColor()

    Resets the AddButtonHoverColor

    Declaration
    public void ResetAddButtonHoverColor()

    ResetEditOnTabPage()

    Declaration
    public void ResetEditOnTabPage()

    ResetToolTips()

    Declaration
    public override void ResetToolTips()
    Overrides
    ButtonBar.ResetToolTips()

    ShouldSerializeEditOnTabPage()

    To Specify EditOnTabPage to be serialized or not

    Declaration
    public bool ShouldSerializeEditOnTabPage()
    Returns
    Type
    System.Boolean

    WndProc(ref Message)

    Declaration
    protected override void WndProc(ref Message msg)
    Parameters
    Type Name Description
    System.Windows.Forms.Message msg
    Overrides
    ArrowButtonBar.WndProc(ref Message)

    Events

    DraggingTab

    Occurs when a tab is dragged by the user. You can set e.Cancel = True to prevent dragging a tab.

    Declaration
    public event TabMovedEventHandler DraggingTab
    Event Type
    Type
    TabMovedEventHandler
    Examples
    public Form1()
    {
    	InitializeComponent();
    	this.tabControl1.Bar.DraggingTab += new TabMovedEventHandler(Bar_DraggingTab);
    }
    private void Bar_DraggingTab(object sender, TabMovedEventArgs e)
    {
    	Console.WriteLine("Bar_DraggingTab {0}, {1}", e.Tab, e.DestTab);
    	e.Cancel = true; // Do not allow dragging the tab
    }

    ImageListChanged

    Occurs when the ImageList has changed.

    Declaration
    public event EventHandler ImageListChanged
    Event Type
    Type
    System.EventHandler

    RelativeWidthChanged

    Occurs when the RelativeWidth property has changed.

    Declaration
    public event EventHandler RelativeWidthChanged
    Event Type
    Type
    System.EventHandler

    SelectedIndexChanged

    Occurs after the selected tab index has changed.

    Declaration
    public event SelectedIndexEventHandler SelectedIndexChanged
    Event Type
    Type
    SelectedIndexEventHandler

    SelectedIndexChanging

    Occurs before the selected tab index is changing.

    Declaration
    public event SelectedIndexEventHandler SelectedIndexChanging
    Event Type
    Type
    SelectedIndexEventHandler

    Explicit Interface Implementations

    IScrollBarContainer.ScrollBar

    Declaration
    Control IScrollBarContainer.ScrollBar { get; set; }
    Returns
    Type
    System.Windows.Forms.Control

    Implements

    IControlToolTipProvider
    ICancelModeProvider
    ISupportUpdating
    IThemedControl
    IScrollBarContainer
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved