Button deaktivieren aktivieren

  • Button deaktivieren aktivieren geht nicht!

    [autoit]


    #include
    #include
    #include
    #include
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 275, 109, 192, 114)
    $btn_goNeu = GUICtrlCreateButton("Button1", 8, 40, 75, 25, $WS_GROUP)
    $Combo1 = GUICtrlCreateCombo("Combo1", 8, 8, 145, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    case $Combo1
    If $i=1 Then
    GUICtrlSetState($btn_goNeu,$GUI_DISABLE) ; Button deaktivieren
    $i=0
    Else
    GUICtrlSetState($btn_goNeu,$GUI_ENABLE) ; Button aktivieren
    $i=1
    EndIf
    Case $btn_goNeu
    Exit
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    2 Mal editiert, zuletzt von gabischatz (27. Februar 2010 um 21:07)

  • kann es sein das da einige befehle durchs posten verloren gegangen sind?

    [autoit]


    Func Ulam($n)
    Return 1
    EndFunc

    [/autoit]


    Rekursion FTW :D

    Einmal editiert, zuletzt von Nathax (30. November 2012 um 21:33)

  • so geht's

    [autoit]

    #include <GUIConstants.au3>
    #Region ### START Koda GUI section ### Form=
    Global $Form1 = GUICreate("Form1", 275, 109, 192, 114)
    Global $btn_goNeu = GUICtrlCreateButton("Button1", 8, 40, 75, 25)
    Global $Combo1 = GUICtrlCreateCombo("Combo1", 8, 8, 145, 25)
    Global $a = ""

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    case $Combo1
    If $a="" Then
    GUICtrlSetState($btn_goNeu,$GUI_DISABLE)
    $a="a"
    Else
    GUICtrlSetState($btn_goNeu,$GUI_ENABLE)
    $a=""
    EndIf
    Case $btn_goNeu
    Exit
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)