Jump to content
Sign in to follow this  

Checkboxes Control as only one Box is Checked

Recommended Posts


Hi i´m a newbie with autoit i found a script for checkboxes i understand the script. but now i search the following option

is it possible to check how many boxes are checked. because i need a test that only one box can be checked not 2 or 3 at the same time.

#include <GUIConstants.au3>

GUICreate("Windows Xp Checkbox",499,488 )

Func _run($q)


Case $q = 0

Msgbox ( 0 , '' , 'Program 1' )

Case $q = 1

Msgbox ( 0 , '' , 'Program 2' )

Case $q = 2

Msgbox ( 0 , '' , 'Program 3' )



GUISetState ()

Opt ( 'GUICoordMode' , 2 )

Dim $a[3]

$a[0]=GUICtrlCreateCheckbox ( '1' , 5 , 5 )

$a[1]=GUICtrlCreateCheckbox ( '2' , -1 , 2 )

$a[2]=GUICtrlCreateCheckbox ( '3' , -1 , 2 )

Opt ( 'GUICoordMode' , 1 )

$okbutton = GUICtrlCreateButton ("Auswahl",200,340,70,20)

While 1

$msg = GUIGetMsg()


Case $msg = $GUI_EVENT_CLOSE


Case $msg = $okbutton




Dim $o[3]

For $n=0 To 2

$o[$n]=GUICtrlRead ( $a[$n] )

If $o[$n]=1 Then _run($n)


Greets Timo


sorry for english for runaways

Share this post

Link to post
Share on other sites

ok i see the options in the help file and if i understood it right this will be the funktion. but if i see the test script from help how can i mix it with the above script

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.