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
TabBar
Assembly: Syncfusion.Shared.Base.dll
public class TabBar : ArrowButtonBar, IControlToolTipProvider, ICancelModeProvider, ISupportUpdating, IInternalArrowButtonParent, IInternalTabParent, IInternalTabBarParent, IInternalButtonParent, IThemedControl, IInternalSplitterParent, IScrollBarContainer
Constructors
Declaration
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
Declaration
public Image m_AddButtonImage
Field Value
| Type |
| System.Drawing.Image |
Declaration
public InternalSpacer m_LeftSpacerChild
Field Value
| Type |
| Syncfusion.Windows.Forms.InternalSpacer |
Declaration
public InternalSpacer m_RightSpacerChild
Field Value
| Type |
| Syncfusion.Windows.Forms.InternalSpacer |
Properties
Gets/Sets the Hover color for AddButton.
Declaration
public Color AddButtonHoverColor { get; set; }
Property Value
| Type |
| System.Drawing.Color |
Gets/Sets AddNewTabBarOption Image in TabBarSplitterControl
Declaration
public Image AddButtonImage { get; set; }
Property Value
| Type |
| System.Drawing.Image |
Declaration
protected override CreateParams CreateParams { get; }
Property Value
| Type |
| System.Windows.Forms.CreateParams |
Declaration
public override DisplayArrowButtons DisplayArrowButtons { get; set; }
Property Value
Overrides
EditOnTabPage
Enable the edit mode in TabBarPage
Declaration
public bool EditOnTabPage { get; set; }
Property Value
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
HoveredTabBarPage
Gets/Sets TabBarPage which is being mouse pointed
Declaration
public TabBarPage HoveredTabBarPage { get; set; }
Property Value
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.
|
Declaration
public InternalSpacer LeftSpacerChild { get; set; }
Property Value
| Type |
| Syncfusion.Windows.Forms.InternalSpacer |
Gets or sets office 2007 color scheme.
Declaration
public Office2007Theme Office2007ColorScheme { get; set; }
Property Value
Gets / sets the width of the tab bar relative to the width of the client bounds.
Declaration
public int RelativeWidth { get; set; }
Property Value
Enables / disables the resizing of tab bar.
Declaration
public bool Resizable { get; set; }
Property Value
Declaration
public InternalSpacer RightSpacerChild { get; set; }
Property Value
| Type |
| Syncfusion.Windows.Forms.InternalSpacer |
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 |
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
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
Gets/Sets whether to show/hide AddNewButton Image
Declaration
public bool ShowAddNewOption { get; set; }
Property Value
Indicates whether ToolTips are being shown for tabs that have ToolTips set on
them.
Declaration
public bool ShowToolTips { get; set; }
Property Value
Declaration
public override ISite Site { get; set; }
Property Value
| Type |
| System.ComponentModel.ISite |
Gets or sets the visual style of the tabBar.
Declaration
public TabBarSplitterStyle Style { get; set; }
Property Value
Gets / sets the inner tab bar that displays the tabs.
Declaration
public InternalTabBar TabBarChild { get; set; }
Property Value
| Type |
| Syncfusion.Windows.Forms.InternalTabBar |
Returns the number of tabs in the strip.
Declaration
public int TabCount { get; }
Property Value
Gets / sets the delta used for drawing the tabs.
Declaration
public int TabFolderDelta { get; set; }
Property Value
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
Gets or sets the visual style of the tabBar.
Declaration
public string ThemeName { get; set; }
Property Value
Methods
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.
|
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
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.
|
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.
|
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type |
Name |
Description |
| System.Boolean |
disposing |
|
Overrides
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
Repaints the splitter bar.
Declaration
public virtual void InvalidateSplitter(object sender)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
The source of the event.
|
Declaration
protected override void OnButtonLookChanged(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Overrides
Declaration
protected override void OnCancelMode(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Overrides
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.
|
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Declaration
protected virtual void OnDraggingTab(TabMovedEventArgs e)
Parameters
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Overrides
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Declaration
protected virtual void OnImageListChanged(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
A System.EventArgs that contains the event data.
|
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.KeyEventArgs |
e |
|
Declaration
protected override void OnLayout(LayoutEventArgs levent)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.LayoutEventArgs |
levent |
|
Overrides
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.MouseEventArgs |
e |
|
Overrides
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected override void OnMouseUp(MouseEventArgs mevent)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.MouseEventArgs |
mevent |
|
Overrides
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.
|
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.
|
Declaration
protected override void OnPaint(PaintEventArgs pe)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.PaintEventArgs |
pe |
|
Overrides
Declaration
protected virtual void OnRelativeWidthChanged(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
Event data.
|
Declaration
protected virtual void OnSetCursor(ref Message m)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.Message |
m |
|
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
| Type |
Name |
Description |
| System.EventArgs |
e |
|
Declaration
protected virtual void OnStyleChanged()
Declaration
protected void RaiseSelectedIndexChangedEvent(SelectedIndexEventArgs e)
Parameters
Declaration
protected void RaiseSelectedIndexChangingEvent(SelectedIndexEventArgs e)
Parameters
Declaration
public override void Refresh()
Overrides
Declaration
protected void RemoveAll()
Removes the tab that holds the specified item as cookie.
Declaration
public void RemoveItem(object item)
Parameters
| Type |
Name |
Description |
| System.Object |
item |
|
Resets the AddButtonHoverColor
Declaration
public void ResetAddButtonHoverColor()
ResetEditOnTabPage()
Declaration
public void ResetEditOnTabPage()
Declaration
public override void ResetToolTips()
Overrides
ShouldSerializeEditOnTabPage()
To Specify EditOnTabPage to be serialized or not
Declaration
public bool ShouldSerializeEditOnTabPage()
Returns
Declaration
protected override void WndProc(ref Message msg)
Parameters
| Type |
Name |
Description |
| System.Windows.Forms.Message |
msg |
|
Overrides
Events
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
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
}
Declaration
public event EventHandler ImageListChanged
Event Type
Declaration
public event EventHandler RelativeWidthChanged
Event Type
Occurs after the selected tab index has changed.
Declaration
public event SelectedIndexEventHandler SelectedIndexChanged
Event Type
Occurs before the selected tab index is changing.
Declaration
public event SelectedIndexEventHandler SelectedIndexChanging
Event Type
Explicit Interface Implementations
Declaration
Control IScrollBarContainer.ScrollBar { get; set; }
Returns
| Type |
| System.Windows.Forms.Control |
Implements