Код:
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("_GUICtrlCreateCheckboxEx", 300, 200)
$aChckBx = _GUICtrlCreateCheckboxEx("Checkbox", 20, 20, 65, 15, 0xFFFFFF, 0xFF0000)
GUISetState(@SW_SHOW, $hGUI)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $aChckBx[1]
If GUICtrlRead($nMsg - 1) = $GUI_CHECKED Then
GUICtrlSetState($nMsg - 1, $GUI_UNCHECKED)
Else
GUICtrlSetState($nMsg - 1, $GUI_CHECKED)
EndIf
EndSwitch
WEnd
Func _GUICtrlCreateCheckboxEx($sText, $iLeft, $iTop, $iWidth, $iHeight, $sBackColor = "" , $sTextColor = "")
Local $aCheckBoxID[2]
$aCheckBoxID[0] = GUICtrlCreateCheckbox("", $iLeft, $iTop, 16, 16)
$aCheckBoxID[1] = GUICtrlCreateLabel($sText, $iLeft + 15, $iTop, $iWidth - 15, $iHeight)
If $sTextColor <> "" And $aCheckBoxID[1] Then
GUICtrlSetColor($aCheckBoxID[1], $sTextColor)
EndIf
If $sBackColor <> "" And $aCheckBoxID[1] Then
GUICtrlSetBkColor($aCheckBoxID[1], $sBackColor)
EndIf
Return $aCheckBoxID
EndFunc