Jump to content
Sign in to follow this  

$GUI_DISABLE a group?

Recommended Posts


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.


Share this post

Link to post
Share on other sites

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

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)

Func _disable($ele)
    For $i = 0 To Ubound($radio) - 1
        If $i = $ele Then
            ; skip
            GUICtrlSetState($radio[$i], $GUI_DISABLE)

EDIT: Revised for cleaner code.

Edited by aslani

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

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