FoD-Freeman Posted January 19, 2006 Share Posted January 19, 2006 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) Select Case $q = 0 Msgbox ( 0 , '' , 'Program 1' ) Case $q = 1 Msgbox ( 0 , '' , 'Program 2' ) Case $q = 2 Msgbox ( 0 , '' , 'Program 3' ) EndSelect EndFunc 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() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $okbutton ExitLoop EndSelect Wend Dim $o[3] For $n=0 To 2 $o[$n]=GUICtrlRead ( $a[$n] ) If $o[$n]=1 Then _run($n) Next Greets Timo ps sorry for english for runaways Link to comment Share on other sites More sharing options...
CyberSlug Posted January 19, 2006 Share Posted January 19, 2006 Easiest way is to use the radio control instead of a checkbox. See GuiCtrlCreateRadio and GuiCtrlCreateGroup in the help file. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
FoD-Freeman Posted January 19, 2006 Author Share Posted January 19, 2006 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 Link to comment Share on other sites More sharing options...
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