Skip to main content
Version: 4.1

TabControl

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Manages a related set of TabPage pages.

public class TabControl : Control

Constructors

Instance member TabControl()

Initializes a new instance of the TabControl class.

Instance member TabControl(onSelectedIndexChanged)

Initializes a new instance of the TabControl class with the specified initial settings.

NameTypeDescription
onSelectedIndexChangedAction<Object, EventArgs>An Action delegate to handle the SelectedIndexChanged event.

Instance member TabControl(tabPages, onSelectedIndexChanged)

Initializes a new instance of the TabControl class with the specified initial settings.

NameTypeDescription
tabPagesTabPage[]An array of TabPage objects to be added to the TabControl.
onSelectedIndexChangedAction<Object, EventArgs>An Action delegate to handle the SelectedIndexChanged event.

Instance member TabControl(location, size, onSelectedIndexChanged)

Initializes a new instance of the TabControl class with the specified initial settings.

NameTypeDescription
locationPointThe location of the TabControl on its parent control.
sizeSizeThe size of the TabControl.
onSelectedIndexChangedAction<Object, EventArgs>An Action delegate to handle the SelectedIndexChanged event.

Instance member TabControl(location, size, tabPages, onSelectedIndexChanged)

Initializes a new instance of the TabControl class with the specified initial settings.

NameTypeDescription
locationPointThe location of the TabControl on its parent control.
sizeSizeThe size of the TabControl.
tabPagesTabPage[]An array of TabPage objects to be added to the TabControl.
onSelectedIndexChangedAction<Object, EventArgs>An Action delegate to handle the SelectedIndexChanged event.

Properties

Instance member Alignment

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

Instance member AllowUserToMoveTabs

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

Instance member AutoActivateFirstChild

Boolean: Returns or sets the option to automatically activate the first focusable control of the TabPage when the SelectedTab is changed. Since 3.5.4 (Default: False)

Instance member BorderStyle

BorderStyle: Indicates the border style for the control. (Default: Solid)

Instance member Display

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

Instance member DisplayRectangle

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

Instance member ImageList

ImageList: Returns or sets the images to display on the control's tabs. (Default: null)

Instance member 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.

Instance member Orientation

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

The default value is Orientation.Horizontal.

Instance member RowCount

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

Tab rows are not currently supported in Wisej.

Instance member ScrollStep

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

Throws:

Instance member SelectedIndex

Int32: Returns or sets the index of the currently selected tab page. (Default: -1)

Throws:

Instance member SelectedTab

TabPage: Returns or sets the currently selected tab page. (Default: null)

Instance member ShowToolTips

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

Instance member ShowVisibilityMenu

Boolean: Returns or sets whether the tab visibility menu button is visible. (Default: False)

Instance member 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.

The default value is TabSizeMode.Normal.

Instance member TabCount

Int32: Gets the number of tabs in the tab strip. (Default: 0)

Instance member TabPages

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

Default value is an empty TabPageCollection

Methods

Protected member CreateControlsInstance()

This member overrides CreateControlsInstance.

Returns: ControlCollection. A new instance of ControlCollection assigned to the control.

Instance member DeselectTab(index)

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

ParameterTypeDescription
indexInt32The index in the TabPages collection of the tab to deselect.

Throws:

Instance member DeselectTab(tabPage)

Makes the tab following the specified TabPage the current tab.

ParameterTypeDescription
tabPageTabPageThe TabPage to deselect.

Throws:

Instance member DeselectTab(tabPageName)

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

ParameterTypeDescription
tabPageNameStringThe Name of the tab to deselect.

Throws:

Protected member FocusFirstChild()

Activates the first eligible child control in the tab page. Since 3.5.4

Invoked when the SelectedTab is changed and the property AutoActivateFirstChild is true.

Instance member GetControl(index)

Returns the TabPage control at the specified location.

ParameterTypeDescription
indexInt32The index of the TabPage to get.

Returns: Control. The TabPage at the specified location.

Throws:

Protected member GetItems()

Returns an array of TabPage controls that belong to the TabControl control.

Returns: Object[]. An array of TabPage controls that belong to the TabControl.

Instance member GetTabRect(index)

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

ParameterTypeDescription
indexInt32The 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:

Instance member GetTabRect(index, callback)

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

ParameterTypeDescription
indexInt32The zero-based index of the tab page for which to retrieve the bounding rectangle of the tab button.
callbackAction<Rectangle>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:

Instance member GetTabRectAsync(index)

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

ParameterTypeDescription
indexInt32The 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:

Protected member GetToolTipText(item)

Returns the ToolTip for the specified TabPage.

ParameterTypeDescription
itemObjectThe TabPage that owns the desired ToolTip.

Returns: String. The ToolTip text.

Protected member IsInputKey(keyData)

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

ParameterTypeDescription
keyDataKeysOne of the Keys values.

Returns: Boolean. true if the specified key is a regular input key; otherwise, false.

Protected member OnControlAdded(e)

Fires the ControlAdded event.

ParameterTypeDescription
eControlEventArgs

Protected member OnControlCreated(e)

Fires the ControlCreated event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDeselected(e)

Fires the Deselected event and the Leave event of the currently active TabPage.

ParameterTypeDescription
eTabControlEventArgsA TabControlEventArgs that contains the event data.

Protected member OnDeselecting(e)

Fires the Deselecting event.

ParameterTypeDescription
eTabControlCancelEventArgsA TabControlCancelEventArgs that contains the event data.

Protected member OnEnter(e)

Fires the Enter event of the currently active TabPage.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnLeave(e)

Fires the Leave event of the currently active TabPage.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnScrollStepChanged(e)

Fires the ScrollStepChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelected(e)

Fires the Selected event and the Enter event of the currently active TabPage.

ParameterTypeDescription
eTabControlEventArgsA TabControlEventArgs that contains the event data.

Protected member OnSelectedIndexChanged(e)

Fires the SelectedIndexChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelecting(e)

Fires the Selecting event.

ParameterTypeDescription
eTabControlCancelEventArgsA TabControlCancelEventArgs that contains the event data.

Protected member OnSizeChanged(e)

Fires the SizeChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnTabClosed(e)

Fires the TabClosed event.

ParameterTypeDescription
eTabControlEventArgsA TabControlEventArgs that contains the event data.

Protected member OnTabClosing(e)

Fires the TabClosing event.

ParameterTypeDescription
eTabControlCancelEventArgsA TabControlCancelEventArgs that contains the event data.

Protected member OnTabMoved(e)

Fires the TabMoved event.

ParameterTypeDescription
eTabControlEventArgsA TabControlEventArgs object that contains the event data.

Protected member OnTabVisibilityChanged(e)

Fires the TabVisibilityChanged event.

ParameterTypeDescription
eTabControlEventArgsA TabControlEventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member OnWebUpdate(state)

Updates the client component using the state information.

ParameterTypeDescription
stateObjectDynamic state object.

Protected member RemoveAll()

Removes all the tab pages and additional controls from this tab control.

Instance member SelectTab(index)

Makes the tab with the specified index the current tab.

ParameterTypeDescription
indexInt32The index in the TabPages collection of the tab to select.

Throws:

Instance member SelectTab(tabPage)

Makes the specified TabPage the current tab.

ParameterTypeDescription
tabPageTabPageThe TabPage to select.

Throws:

Instance member SelectTab(tabPageName)

Makes the tab with the specified name the current tab.

ParameterTypeDescription
tabPageNameStringThe Name of the tab to select.

Throws:

Events

Instance member Deselected

TabControlEventHandler Fired when a tab is deselected.

Instance member Deselecting

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

Instance member ScrollStepChanged

EventHandler Fired when the value of ScrollStep changes.

Instance member Selected

TabControlEventHandler Fired when a tab is selected.

Instance member SelectedIndexChanged

EventHandler Fired when the SelectedIndex property has changed.

Instance member Selecting

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

Instance member TabClosed

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

Instance member TabClosing

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

Instance member TabMoved

TabControlEventHandler Fired when the user drags a TabPage into a new position and the AllowUserToMoveTabs property is set to true.

Instance member TabVisibilityChanged

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

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.