The TabControl represents a container of items, whose contents are displayed in the same area. The TabPage control derives from WindowBase and represents a window with header and content. The content of only one of the tabs in the TabControl is displayed at a time.
Use the Tabs property to get a reference to the control's collection of TabPages.
Set the SelectedIndex property to display the corresponding tab.
The TabControl exposes a set of properties, allowing customization of its default appearance and behavior. The TabStripPlacement property specifies the position of the tab headers. The Multiline property allows the tab headers to be displayed in more than one row or column. Use the TabStripScroll property to enable scrolling of the tab header. Users can also be allowed to reorder the tab headers by setting the EnableReorder property to true.
Use TabControl.Tabs.Add method to add a new tab to the collection.
C#
![]() |
---|
TabPage tab = new TabPage(); |
VB.NET
![]() |
---|
Dim tab As New TabPage() |
Use TabControl.Tabs.Remove or TabControl.Tabs.RemoveAt to remove a specified tab from the collection.
C#
![]() |
---|
TabControl1.Tabs.Remove(TabControl1.Tabs[TabControl1.Tabs.Count - 1]); |
VB.NET
![]() |
---|
TabControl1.Tabs.Remove(TabControl1.Tabs(TabControl1.Tabs.Count - 1)) |
The following events are exposed by the TabControl.
Event | Event arguments | Description |
---|---|---|
System.EventArgs | Raised when the value of the SelectedIndex property has changed. | |
Raised when a tab is selected. | ||
Raised when a tab is deselected. | ||
Raised when a tab page is created. | ||
Raised when a tab page is deleted. |
You can access the control on the client side by its ClientID.
JavaScript
![]() |
---|
var tabControl = $find("TabControl1"); |
Use the getAllTabs method to get a reference to the control's tabs array. Use the getActiveTab method to access the currently displayed tab.
JavaScript
![]() |
---|
tabControl.selectTab(tabControl.getAllTabs()[2]); |
Use the TabControl.createTab method to add a new tab to its tabs array. The createTab method accepts as parameter a JSON object, containing the data for the new tab. Use the data object to define values for the properties and events, exposed by the TabPage class.
JavaScript
![]() |
---|
tabControl.createTab({ |
Use the TabControl.deleteTab method to remove a specified tab from the array.
JavaScript
![]() |
---|
tabControl.deleteTab(tabControl.getAllTabs()[0]); |
The following client-side events are exposed by the TabControl class.
Event | Event arguments | Script property | Description |
---|---|---|---|
- | Raised just after the control has finished loading and is ready for interaction. | ||
Raised when the active tab in a tab control is about to be changed. | |||
Raised when the active tab in a tab control has changed. |
The following client-side events are exposed by the TabPage class.
Event | Event arguments | Script property | Description |
---|---|---|---|
Raised when the user clicks the header of the control. | |||
- | Raised when the internal iframe has finished loading. | ||
- | Raised just after the control has finished loading and is ready for interaction. |