stev379 Posted June 25, 2008 Posted June 25, 2008 I have some radio buttons in a group and can enable or disable the radio buttons singularly, but I'm not able to disable the entire group. Is it even possible to disable (gray out) an entire group? $Chk_Comps is a radio button If GUICtrlRead($Chk_Comps) = $GUI_CHECKED Then GUICtrlSetState($Grp_Users, $GUI_DISABLE) PS - Is anyone else having trouble with the forum search today. I can't tell if it's my network or an internal problem on the site, but it's been much slower that the quick return I'm used to. Thanks!
aslani Posted June 25, 2008 Posted June 25, 2008 (edited) Here's one solution. #include <GUIConstants.au3> GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered Dim $radio[6] $top = 10 For $a = 0 To 5 $radio[$a] = GUICtrlCreateRadio ("Radio " & $a+1, 10, $top, 120, 20) $top += 20 Next GUISetState () ; will display an dialog box with 1 checkbox ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop For $b = 0 To Ubound($radio) - 1 If $msg = $radio[$b] And BitAND(GUICtrlRead($radio[$b]), $GUI_CHECKED) = $GUI_CHECKED Then _disable($B) Next Wend Func _disable($ele) For $i = 0 To Ubound($radio) - 1 If $i = $ele Then ; skip Sleep(5) Else GUICtrlSetState($radio[$i], $GUI_DISABLE) EndIf Next EndFunc EDIT: Revised for cleaner code. Edited June 25, 2008 by aslani [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version
Xandl Posted June 26, 2008 Posted June 26, 2008 Hello,here is another solution: http://www.autoitscript.com/forum/index.php?showtopic=74612ciaoXandl
stev379 Posted June 26, 2008 Author Posted June 26, 2008 Hello,here is another solution: http://www.autoitscript.com/forum/index.php?showtopic=74612ciaoXandlThanks to both of you! Xandl's solution was a best fit, but both are great options.Thanks!!!-Steve
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