TAB statement  

Purpose

A Tab Control is analogous to the dividers in a notebook. It displays one particular page, selecting it from multiple pages, when the user chooses the corresponding tab. The TAB statement is used to manipulate a TAB control.

Syntax

TAB DELETE hDlg, id&, page&
TAB GET COUNT hDlg, id& TO datav&
TAB GET DIALOG hDlg, id&, page& TO Hndlv&
TAB GET SELECT hDlg, id& TO datav&
TAB INSERT PAGE hDlg, id&, page&, image&, text$ [CALL CallBack] TO Hndlv&
TAB RESET hDlg, id&
TAB SELECT hDlg, id&, page&
TAB SET IMAGELIST hDlg, id&, hLst

hDlg

Handle of the dialog that owns the Tab Control.

id&

The control identifier assigned with CONTROL ADD TAB.

Remarks

In each of the following samples and descriptions, the Tab Control that is the subject of the statement is identified by the handle of the dialog that owns the Tab Control (hDlg), and the unique control identifier you gave it upon creation in CONTROL ADD TAB.

TAB DELETE hDlg, id&, page&

The page specified by the index parameter page& is deleted from the Tab Control. The index is 1 for the first item, 2 for the second item, etc.

TAB GET COUNT hDlg, id& TO datav&

The number of pages in the TAB Control is retrieved, and assigned to the long integer variable specified by datav&.

TAB GET DIALOG hDlg, id&, page& TO Hndlv&

The handle of a child dialog attached to the TAB Control is retrieved and assigned to the variable designated by Hndlv&.  The specific dialog to be returned is determined by the value of the parameter page& (1=first, 2=second, etc.).  If that page/dialog does not exist, the value zero is assigned to Hndlv&.

TAB GET SELECT hDlg, id& TO datav&

The index of the currently selected page in the Tab Control is retrieved, and assigned to the variable specified by datav&.  The index is 1 for the first item, 2 for the second item, etc.  If there is no current selection, the value zero (0) is assigned.

TAB INSERT PAGE hDlg, id&, page&, image&, text$ [CALL CallBack] TO Hndlv&

A page is added to this TAB Control.  The parameter page& specifies the position of the page to be inserted (1=first, 2=second, etc.).  An optional image to be displayed on the tab area is selected from the attached IMAGELIST, based upon the parameter image& (1=first, 2=second, etc.).  Set image& to 0 if no image is desired.  The text$ parameter specifies the text to be displayed on the tab area.  CallBack is the name of a callback procedure to be used for the page dialog.  The handle of the newly created dialog is assigned to the variable designated by Hndlv&.

TAB RESET hDlg, id&

All pages in the specified Tab Control are deleted.

TAB SELECT hDlg, id&, page&

The page specified by page& parameter is chosen as the selected page for the TAB control, and the associated dialog is displayed.  The value of item& = 1 for the first item, 2 for the second item, etc.

TAB SET IMAGELIST hDlg, id&, hLst

The IMAGELIST specified by hLst is attached to this TAB control.  The graphical images contained in the IMAGELIST are displayed on the tabs of this control.  The image to be displayed is determined by the specification made in TAB INSERT PAGE.  When the TAB control is destroyed, any attached IMAGELIST is automatically destroyed.

See also

Dynamic Dialog Tools, CONTROL ADD TAB, CONTROL SET FONT, DIALOG FONT, DIALOG SET COLOR, IMAGELIST