Re: GUI checkbox question
"valery_vi" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
Steve,
This is an example of synchonized checkboxes:
#include <GUIConstants.au3>
GUICreate ("")
$n=GUICtrlCreateCheckbox ("N-checkbox",10,10)
GUICtrlSetState (-1,1)
$m=GUICtrlCreateCheckbox ("M-checkbox",10,30)
GUICtrlSetState (-1,1)
GUISetState ()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
ExitLoop
elseif $msg = $n then
msgbox (0,"state",StringFormat("GUICtrlRead=%
d\nGUICtrlGetState=%d",GUICtrlRead($n),GUICtrlGetState($n)))
elseif $msg = $m then
GUICtrlSetState ($n,GUICtrlRead($m))
endif
Wend
> This ticks the checkbox, but what does the -1 do?
-1 - meant previous control defined by command GUICtrlCreate....(...)
Valery
--- In [email protected], Steve <xirconuk@...> wrote:
>
> Hi Guys,
>
> I have created my first form with Koda and don't understand a
couple of
> things:
>
> <snippet>
> $Checkbox7 = GUICtrlCreateCheckbox("Backup Archive (only required
after
> Archive)", 51, 212, 233, 17)
>
> $Checkbox8 = GUICtrlCreateCheckbox("Delete Archives and
recreate ", 51,
> 262, 233, 17)
> <snippet>
>
> Basically what the code does is to give the option to recreate the
rar
> archives from scratch, which sometimes gives a significant size
saving.
> If this is done I need to force a recreate of the archive rar file.
>
> Both checkboxes are unticked. How do I "tick" checkbox 7
automatically
> if checkbox 8 is ticked manually?
>
> Also can't get my head around GUICtrlSetState in general:
>
> <snippet>
> $Checkbox6 = GUICtrlCreateCheckbox("Backup Bacs Files", 51, 182,
121, 17)
> GUICtrlSetState(-1, $GUI_CHECKED)
> <snippet>
>
> This ticks the checkbox, but what does the -1 do?
>
> Sorry for being so dim!
>
> Steve
>