GuiCtrlCreateRadio deaktivieren?

  • Ich wollte heute meinem GUI ein paar neue Funktionen geben als ich versucht habe eine Gruppe zu deaktivieren solange eine Checkbox nicht aktiviert ist

    blos wollen bei mir die Radio Buttons sich nicht deaktivieren :/

    [autoit]

    $radio1 = GUICtrlCreateRadio("Bei neuen Beiträgen", 30, 85, -1, -1, $WS_DISABLED)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $radio2 = GUICtrlCreateRadio("Bei", 30, 110, -1, -1, $WS_DISABLED)

    [/autoit]

    aber beide sind immer aktiv


    irgendwie find ich auch sonst nirgendwo einen Lösungsansatz für das Problem :pinch:

  • Versuchs mal mit

    [autoit]

    $radio1 = GUICtrlCreateRadio("Bei neuen Beiträgen", 30, 85, -1, -1)
    GUICtrlSetState(-1, $GUI_CHECKED)
    GUICtrlSetState($radio1, $GUI_DISABLE)
    $radio2 = GUICtrlCreateRadio("Bei", 30, 110, -1, -1)
    GUICtrlSetState($radio2, $GUI_DISABLE)

    [/autoit]
  • Du suchst sicher nach " $GUI_ENABLE, $GUI_DISABLE"! 8)

    [autoit]


    #include <GUIConstantsEx.au3>

    [/autoit][autoit][/autoit][autoit]

    Global $tate = $GUI_ENABLE, $aRadiobox[2]
    #region ### START Koda GUI section ###
    GUICreate("Radiobox Status Switch", 400, 180)
    $close = GUICtrlCreateButton("Cancel", 270, 120, 120, 49)
    $tart = GUICtrlCreateButton("OK", 140, 120, 120, 49)
    $ckb = GUICtrlCreateCheckbox('All off/on', 10, 120, 120, 49)
    $aRadiobox[0] = GUICtrlCreateRadio("Paint", 10, 39, 120, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $aRadiobox[1] = GUICtrlCreateRadio("Notepad", 10, 80, 120, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    GUICtrlCreateLabel("Radiobox", 123, 10, 191, 36)
    GUICtrlSetFont(-1, 20, 800, 0, "arial")
    GUICtrlSetColor(-1, 0x006AB9)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3, $close
    ExitLoop
    Case $tart
    If BitAND(GUICtrlRead($aRadiobox[0]), 1) Then Run('mspaint.exe')
    If BitAND(GUICtrlRead($aRadiobox[1]), 1) Then Run('Notepad.exe')
    Case $ckb
    $tate = BitXOR($tate, $GUI_ENABLE, $GUI_DISABLE)
    For $k = 0 To 1 ;i statisch kein Ubound
    GUICtrlSetState($aRadiobox[$k], $tate)
    Next
    EndSwitch
    WEnd
    ; Ende

    [/autoit]
  • @Eddy, dann verwende es doch als Funktion! ;)

    [autoit]


    Global $aRadiobox[2]
    #region ### START Koda GUI section ###
    GUICreate("RadioboxStatusSwitch - Tut 3", 400, 180)
    $bnClose = GUICtrlCreateButton("Cancel", 270, 120, 120, 49)
    $bnStart = GUICtrlCreateButton("OK", 140, 120, 120, 49)
    $ckbAll = GUICtrlCreateCheckbox('All off/on', 10, 120, 120, 49)
    $aRadiobox[0] = GUICtrlCreateRadio("Paint", 10, 39, 120, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $aRadiobox[1] = GUICtrlCreateRadio("Notepad", 10, 80, 120, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    GUICtrlCreateLabel("Radiobox", 123, 10, 191, 36)
    GUICtrlSetFont(-1, 20, 800, 0, "arial")
    GUICtrlSetColor(-1, 0x006AB9)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3, $bnClose
    ExitLoop
    Case $bnStart
    If BitAND(GUICtrlRead($aRadiobox[0]), 1) Then Run('mspaint.exe')
    If BitAND(GUICtrlRead($aRadiobox[1]), 1) Then Run('Notepad.exe')
    Case $ckbAll
    _allOnOff()
    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit]

    Func _allOnOff()
    If BitAND(GUICtrlRead($ckbAll), 1) Then
    GUICtrlSetData($ckbAll, "All on")
    GUICtrlSetState($aRadiobox[0], 128)
    GUICtrlSetState($aRadiobox[1], 128)
    Else
    GUICtrlSetData($ckbAll, "All off")
    GUICtrlSetState($aRadiobox[0], 64)
    GUICtrlSetState($aRadiobox[1], 64)
    EndIf
    EndFunc ;==>_allOnOff
    ; Ende

    [/autoit]