# Function Reference

GUICtrlCreateCheckbox

Creates a Checkbox control for the GUI.

GUICtrlCreateCheckbox ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control checkbox.
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) : $BS_AUTOCHECKBOX. forced styles : $WS_TABSTOP, and $BS_AUTOCHECKBOX if no checkbox style defined.
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

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlSet....
A Checkbox control can display an icon or image by using the $BS_ICON or $BS_BITMAP style. Use GUICtrlSetImage to specify the picture to use.
To combine styles with the default style use BitOr($GUI_SS_DEFAULT_CHECKBOX, newstyle,...).
Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlSet..., GUIGetMsg

Example

#include <GUIConstants.au3>
GUICreate("My GUI Checkbox") ; will create a dialog box that when displayed is centered
$checkCN = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)
GUISetState () ; will display an dialog box with 1 checkbox
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend