Function Reference


Creates a Tab control for the GUI.

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


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.
exStyle [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

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


A tab control is a control which can only contain tabitem controls. Any other controls should be created within these tabitems using GUICtrlCreate... functions as shown in the example. It is important to close the tab structure by creating a final tabitem control with a null text - GUICtrlCreateTabItem("").

To set or change information in the control see GUICtrlUpdate...() functions.

To combine styles with the default style use BitOR($GUI_SS_DEFAULT_TAB, newstyle, ... ).
To use the default value add #include <TabConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

A GUI can only hold a single tab control, but it is possible to create child GUIs each holding a tab control.


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


#include <GUIConstantsEx.au3>


Func Example()
        GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered

        GUISetFont(9, 300)

        GUICtrlCreateTab(10, 10, 200, 100)

        GUICtrlCreateLabel("label0", 30, 80, 50, 20)
        GUICtrlCreateButton("OK0", 20, 50, 50, 20)
        GUICtrlCreateInput("default", 80, 50, 70, 20)

        GUICtrlCreateLabel("label1", 30, 80, 50, 20)
        GUICtrlCreateCombo("", 20, 50, 60, 120)
        GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
        GUICtrlCreateButton("OK1", 80, 50, 50, 20)

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

        GUICtrlCreateTabItem("") ; end tabitem definition

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


        Local $idMsg
        ; Loop until the user exits.
        While 1
                $idMsg = GUIGetMsg()

                If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop
EndFunc   ;==>Example