SelectTab

Description

Selects the specified tab, displaying its tab page in the Tab control.

Applies to

Tab controls

Syntax

tabcontrolname.SelectTab ( tabidentifier )

Argument

Description

tabcontrolname

The name of the Tab control in which you want to select a tab

tabidentifier

The tab you want to select. You can specify:

  • The tab page index (an integer)

  • The name of the user object (datatype DragObject or UserObject)

  • A string holding the name of the user object


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs.

Usage

Equivalent syntax

You can select a tab by setting the SelectedTab property to the tab's index number:

tab_1.SelectedTab = 3

Examples

These three examples select the third tab in tab_1. They could be in the script for a CommandButton on the window containing the Tab control tab_1:

tab_1.SelectTab(3)
tab_1.SelectTab(tab_1.uo_3)
string ls_tabpage
ls_tabpage = "uo_3"
tab_1.SelectTab(ls_tabpage)

This example opens an instance of the user object uo_fontsettings as a tab page and selects it:

userobject uo_tabpage
string ls_tabpage
ls_tabpage = "uo_fontsettings"
tab_1.OpenTab(uo_tabpage, ls_tabpage, 0)
tab_1.SelectTab(uo_tabpage)

See also

OpenTab