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&, PageNum& TAB GET COUNT hDlg, ID& TO CountVar& TAB GET DIALOG hDlg, ID&, PageNum& TO PageDlgVar& TAB GET IMAGE hDlg, ID&, PageNum& TO ImageVar& TAB GET PAGE PageDlg TO PageNumVar& TAB GET SELECT hDlg, ID& TO PageNumVar& TAB GET TEXT hDlg, ID&, PageNum& TO TextVar$ TAB INSERT PAGE hDlg, ID&, PageNum&, Image&, Text$ [CALL CallBack] TO PageDlgVar& TAB RESET hDlg, ID& TAB SELECT hDlg, ID&, PageNum& TAB SET IMAGE hDlg, ID&, PageNum&, Image& TAB SET IMAGELIST hDlg, ID&, hLst TAB SET TEXT hDlg, ID&, PageNum&, Text$ Function Form: CountVar& = TAB(COUNT, hDlg, ID&) PageDlgVar& = TAB(DIALOG, hDlg, ID&, PageNum&) ImageVar& = TAB(IMAGE, hDlg, ID&, PageNum&) PageNumVar& = TAB(PAGE, PageDlg&) PageNumVar& = TAB(SELECT, hDlg, ID&) TextVar$ = TAB$(TEXT, hDlg, ID&, PageNum&) |
hDlg |
|
id& |
The control identifier assigned with CONTROL ADD TAB. |
Remarks |
In each of the following 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 ID you gave it upon creation in CONTROL ADD TAB. Whenever a TAB page number or IMAGELIST image number is referenced, it is indexed to one. That is, the first item is 1, the second item is 2, etc. Variations of TAB which return a single value may be written in the optional Function Form, as shown above. These functions may be embedded in an expression of any complexity. TAB DELETE hDlg, ID&, PageNum& The page specified by the PageNum& parameter is deleted from the Tab Control. TAB GET COUNT hDlg, id& TO CountVar& The number of pages in the TAB Control is retrieved, and assigned to the long integer variable specified by CountVar&. TAB GET DIALOG hDlg, ID&, PageNum& TO PageDlgVar& The handle of the child dialog attached to a TAB Control page is retrieved and assigned to the variable designated by PageDlgVar&. The dialog handle to be returned is determined by the value of the parameter PageNum&. If that page/dialog not exist, the value zero is returned. TAB GET IMAGE hDlg, ID&, PageNum& TO ImageVar& The index of the image displayed on the specified TAB page is retrieved, and assigned to the variable specified by ImageVar&. If no image is displayed, the value zero (0) is assigned. TAB GET PAGE PageDlg TO PageNumVar& Given the handle of a TAB Page Dialog, the PageNum is retrieved, and assigned to the variable specified by PageNumVar&. This may be particularly useful when you process CallBack messages for Tab Page Dialogs. If you also need Parent and ID information, you can use WINDOW GET. TAB GET SELECT hDlg, id& TO SelectVar& The index of the currently selected page in the Tab Control is retrieved, and assigned to the variable specified by SelectVar&. If there is no current selection, the value zero (0) is assigned. TAB GET TEXT hDlg, ID&, PageNum& TO TextVar$ The text displayed on the specified page tab is retrieved, and assigned to the variable specified by TextVar$. TAB INSERT PAGE hDlg, ID&, PageNum&, Image&, Text$ [CALL CallBack] TO PageDlgVar& A page is added to this TAB Control. The parameter PageNum& specifies the position of the page to be inserted. An optional image to be displayed on the tab area is selected from the attached IMAGELIST, based upon the parameter Image&. 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 PageDlgVar&. TAB RESET hDlg, id& All pages in the specified Tab Control are deleted. TAB SELECT hDlg, ID&, PageNum& The page specified by the PageNum& parameter is chosen as the selected page for the TAB control, and the associated dialog is displayed. TAB SET IMAGE hDlg, ID&, PageNum&, Image& The image specified by the parameter Image& is displayed on the page tab specified by the parameter PageNum&. 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 or TAB SET IMAGE. When the TAB control is destroyed, any attached IMAGELIST is automatically destroyed. TAB SET TEXT hDlg, ID&, PageNum&, Text$ The text in the parameter Text$ is displayed on the tab of the page specified by PageNum&. |
See also |
Dynamic Dialog Tools, CONTROL ADD TAB, CONTROL SET FONT, IMAGELIST |