Function Reference

GUICtrlCreateTab

Creates a Tab control for the GUI.

GUICtrlCreateTab ( left, top [, width [, height [, style [, exStyle]]]] )

 

Parameters

left The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width [optional] The width of the control (default is the previously used width).
height [optional] The height of the control (default is the previously used height).
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default ( -1) : none.
forced styles : $WS_TABSTOP, $WS_CLIPSIBLINGS
exStyle [optional] Defines the extended style of the control. See Extended Style Table.

 

Return Value

Success: Returns the identifier (controlID) of the new control.
Failure: Returns 0.

 

Remarks

This control is just a control in which the tabitem controls will be created and after the specific control related to a specific tabitem will be created with GUICtrlCreate... controls.

To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_TAB, newstyle,...).

To use the value specified above you must #include <TabConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

ONLY one Tab control can be created by window. But a script can creates several windows having a tab in.

 

Related

GUICtrlCreateTabItem, GUICoordMode (Option), GUICtrlCreate..., GUICtrlUpdate..., GUIGetMsg

 

Example


#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg
   
    GUICreate("My GUI Tab")  ; will create a dialog box that when displayed is centered

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    $tab = GUICtrlCreateTab(10, 10, 200, 100)

    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW)  ; will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem("")    ; end tabitem definition

    GUICtrlCreateLabel("label3", 20, 130, 50, 20)

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
       
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example