Function GUICtrlCreateGroup

Function Reference


GUICtrlCreateGroup

Creates a Group control for the GUI.

GUICtrlCreateGroup ( "text", left, top [, width [, height [, style = -1 [, exStyle = -1]]]] )

Parameters

text The text of the control.
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_GROUP, $BS_GROUPBOX.
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.

Remarks

A group control is the thin line you see around controls (usually only Radio button) that visually groups them together. Only one Radio button within a Group can be selected at once.
If you want to have multiple groups without the visible line then you must use GUIStartGroup() to group your Radio buttons.

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

Default resizing is $GUI_DOCKAUTO size and position will occur.

Related

GUICoordMode (Option), GUIStartGroup

Example

#include <GUIConstantsEx.au3>

Example()

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

    GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
    GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
    GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    GUISetState(@SW_SHOW) ; will display an empty dialog box

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example