TabControl

Wisej.Web.TabControl

Namespace: Wisej.Web

Assembly: Wisej.Framework (2.5.0.0)

Manages a related set of TabPage pages.

public class TabControl : Control

Constructors

TabControl()

Initializes a new instance of the TabControl class.

Properties

Alignment

TabAlignment: Returns or sets the area of the control (for example, along the top) where the tabs are aligned.

AllowUserToMoveTabs

Boolean: Returns or sets whether the user can change the position of a tab button by dragging it.

BorderStyle

BorderStyle: Indicates the border style for the control.

Display

Display: Returns or sets the Display mode of the control to determine whether to display the icon, the text or both.

DisplayRectangle

Rectangle: Returns the display area of the control's tab pages.

ImageList

ImageList: Returns or sets the images to display on the control's tabs.

ItemSize

Size: Returns or sets the fixed size of the tab buttons. The default value is Empty to use the itemSize set in the current theme or auto sizing.

When set to Empty (default) it uses the itemSize set in the theme. You can also set only the width or the height and leave the other value set to 0 to use the value in the current theme or auto sizing. The width (or height when Alignment is Left or Right) is applied when the value SizeMode is Fixed or Center. The height (or width when Alignment is Top or Bottom) is applied always.

Orientation

Orientation: Returns or sets a value indicating the horizontal or vertical orientation of the TabControl tabs.

RowCount

Int32: Returns the number of rows that are currently being displayed in the control's tab strip.

ScrollStep

Int32: Returns or sets the number of pixels to scroll when the scroll buttons are pressed.

Throws:

SelectedIndex

Int32: Returns or sets the index of the currently selected tab page.

Throws:

SelectedTab

TabPage: Returns or sets the currently selected tab page.

ShowToolTips

Boolean: Returns or sets whether a tab's ToolTip is shown when the mouse passes over the tab.

ShowVisibilityMenu

Boolean: Returns or sets whether the tab visibility menu button is visible.

SizeMode

TabSizeMode: Returns or sets whether the tab buttons should fill the control's size, or placed in the center, or use the size set in ItemSize.

TabCount

Int32: Gets the number of tabs in the tab strip.

TabPages

TabPageCollection: Returns the collection of tab pages in this tab control.

Methods

DeselectTab(index)

Makes the tab following the tab with the specified index the current tab.

Parameter
Type
Description

index

The index in the TabPages collection of the tab to deselect.

Throws:

DeselectTab(tabPage)

Makes the tab following the specified TabPage the current tab.

Parameter
Type
Description

tabPage

The TabPage to deselect.

Throws:

DeselectTab(tabPageName)

Makes the tab following the tab with the specified name the current tab.

Parameter
Type
Description

tabPageName

The Name of the tab to deselect.

Throws:

GetControl(index)

Returns the TabPage control at the specified location.

Parameter
Type
Description

index

The index of the TabPage to get.

Returns: Control. The TabPage at the specified location.

Throws:

GetTabRect(index)

Returns the bounding rectangle for the tab button of the TabPage at the specified index in this TabControl control.

Parameter
Type
Description

index

The zero-based index of the tab page for which to retrieve the bounding rectangle of the tab button.

Returns: Rectangle. A Rectangle that represents the bounds of the specified tab.

Bounding rectangles for the tab buttons are received from the client and are updated asynchronously. If the application adds a tab page, or changes any property that causes the tab button to be resized (orientation, sizing, text, alignment, etc.) it cannot immediately after retrieve the new bounds. When the tab rectangles are updated, the TabControl will fire the StyleChanged event to inform the application that the bounding rectangles have been updated. In alternative, you can use the GetTabRect and GetTabRectAsync overloads to query the client and receive the new bounding rectangle for the request tab page. Bounding rectangles are always empty until the TabControl has been rendered on the client. Throws:

GetTabRect(index, callback)

Retrieves the bounding rectangle for the tab button of the TabPage at the specified index in this TabControl control.

Parameter
Type
Description

index

The zero-based index of the tab page for which to retrieve the bounding rectangle of the tab button.

callback

Callback method that will receive the bounding rectangle for the request tab button.

Bounding rectangles are always empty until the TabControl has been rendered on the client. Throws:

GetTabRectAsync(index)

Retrieves the bounding rectangle for the tab button of the TabPage at the specified index in this TabControl control.

Parameter
Type
Description

index

The zero-based index of the tab page for which to retrieve the bounding rectangle of the tab button.

Returns: Task<Rectangle>.

Bounding rectangles are always empty until the TabControl has been rendered on the client. Throws:

SelectTab(index)

Makes the tab with the specified index the current tab.

Parameter
Type
Description

index

The index in the TabPages collection of the tab to select.

Throws:

SelectTab(tabPage)

Makes the specified TabPage the current tab.

Parameter
Type
Description

tabPage

The TabPage to select.

Throws:

SelectTab(tabPageName)

Makes the tab with the specified name the current tab.

Parameter
Type
Description

tabPageName

The Name of the tab to select.

Throws:

Events

Deselected

TabControlEventHandler Fired when a tab is deselected.

Deselecting

TabControlCancelEventHandler Occurs before a tab is deselected, enabling a handler to cancel the tab change.

ScrollStepChanged

EventHandler Fired when the value of ScrollStep changes.

Selected

TabControlEventHandler Fired when a tab is selected.

SelectedIndexChanged

EventHandler Fired when the SelectedIndex property has changed.

Selecting

TabControlCancelEventHandler Occurs before a tab is selected, enabling a handler to cancel the tab change.

TabClosed

TabControlEventHandler Occurs after a tab is closed by the user and has been removed from the tab control.

TabClosing

TabControlCancelEventHandler Occurs before a tab is closed by the user, enabling a handler to cancel the tab closing.

TabVisibilityChanged

TabControlEventHandler Occurs after a tab is shown or hidden by the user through the ShowVisibilityMenu or programmatically through the Hidden property.

Implements

Name
Description

Bindable components implement this interface.

All wisej components implement this interface.

All wisej controls derived from the Control class must implement this interface.

Allows an object to serialize itself.

Last updated

Was this helpful?