728x90

☑️ 체크박스 활성화

🟩 체크박스 비활성화

#NoEnv
#SingleInstance, Force

    Gui, Add, GroupBox, w260 h100 Section
    Gui, Add, Checkbox, xs+5 ys gonCB_Click Checked hwndhCB1, Breakfast
    Gui, Add, Radio, xs+20 ys+20 w100 hwndhRB11, Toast
    Gui, Add, Radio, y+12 w100 hwndhRB12, Pancakes
    Gui, Add, Radio, y+12 w100 hwndhRB13, Pickles

    Gui, Add, GroupBox, xm w260 h100 Section
    Gui, Add, Checkbox, xs+5 ys gonCB_Click Checked hwndhCB2, Lunch
    Gui, Add, Radio, xs+20 ys+20 w100 hwndhRB21, Sandwich
    Gui, Add, Radio, y+12 w100 hwndhRB22, Soup
    Gui, Add, Radio, y+12 w100 hwndhRB23, Rack of Lamb
    Gui, Show

    Children := {}
    Children.Push({hwnd: hCB1})
    Children.Push({hwnd: hCB2})

    Children[1].Push(hRB11)
    Children[1].Push(hRB12)
    Children[1].Push(hRB13)

    Children[2].Push(hRB21)
    Children[2].Push(hRB22)
    Children[2].Push(hRB23)

Return

GuiClose:
ExitApp



;-------------------------------------------------------------------------------
onCB_Click(hwnd, GuiEvent, EventInfo, ErrLevel := "") {
;-------------------------------------------------------------------------------
    global Children
    SetFormat, Integer, h
    GuiControlGet, state,, % hwnd += 0
    Loop, 2
        If Children[A_Index].hwnd = hwnd {
            Index := A_Index
            Break
        }
    For each, Child in Children[Index]
        If Not (Child = hwnd)
            GuiControl, % (state ? "Enable":"Disable"), %Child%
}

 

Checked groupbox.ahk
0.00MB

728x90

+ Recent posts