dvlkn Posted June 4, 2008 Posted June 4, 2008 (edited) Hi Can anyone show me how to perform looping through controls (check boxes in this case) ? I know that the code in visual basic is something like: Dim I As Integer For I = 1 To 4 Me.Controls("Checkbox" & I).Value = True Next But how to do it in autoIT ? Edited June 4, 2008 by dvlkn
Malkey Posted June 4, 2008 Posted June 4, 2008 Hi Can anyone show me how to perform looping through controls (check boxes in this case) ? I know that the code in visual basic is something like: Dim I As Integer For I = 1 To 4 Me.Controls("Checkbox" & I).Value = True Next But how to do it in autoIT ? This is one way to do it. Hope it helps. You are going to have to get to know the help file intimately. ; Modified Example of GUICtrlCreateCheckbox Function from Help #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $checkCN[5], $msg, $I GUICreate("My GUI Checkbox") ; will create a dialog box that when displayed is centered GUISetState() For $I = 1 To 4 $checkCN[$I] = GUICtrlCreateCheckbox("CHECKBOX " & $I, 10, 10+($I*23), 120, 20) GUICtrlSetState($checkCN[$I],$GUI_CHECKED) Next GUICtrlSetState($checkCN[2],$GUI_UNCHECKED) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now