GUI Buttons ausgrauen

  • Hallo,

    ist es möglich die Buttons in Sektion 1 und 2 solange auszugrauen bis der Knopf "Loginfunktion" gedrückt und die zugehörige Funktion ausgeführt wurde?
    Sprich der Benutzer soll sich erst einloggen bis er Zugriff auf die anderen Knöpfe hat.

    Kann euch bis jetzt nur den Quellcode der GUI zeigen:

    Spoiler anzeigen
    [autoit]

    #include <GUIStatusBar.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    $_Version = "Version"

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Programmname", 365, 380, 200, 125)
    $ButtonLI = GUICtrlCreateButton("Loginfunktion", 30, 25, 130, 25, 0)
    $ButtonLO = GUICtrlCreateButton("Logoutfunktion", 200, 25, 130, 25, 0)

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

    GUICtrlCreateGroup("Sektion 1", 20, 75, 320, 70)
    $Button1 = GUICtrlCreateButton("Knopf 1", 30, 100, 130, 25, 0)
    $Button2 = GUICtrlCreateButton("Knopf 2", 200, 100, 130, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;

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

    GUICtrlCreateGroup("Sektion 2", 20, 180, 320, 150)
    $Button3 = GUICtrlCreateButton("Knopf 3", 30, 230, 130, 25, 0)
    $Button4 = GUICtrlCreateButton("Knopf 4", 200, 230, 130, 25, 0)
    $Button5 = GUICtrlCreateButton("Knopf 5", 30, 280, 130, 25, 0)
    $Button6 = GUICtrlCreateButton("Knopf 6", 200, 280, 130, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

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

    $statusbar = _GUICtrlStatusBar_Create($Form1)
    _GUICtrlStatusBar_SetSimple($statusbar, True)
    _GUICtrlStatusBar_SetText($statusbar, $_Version)
    _GUICtrlStatusBar_SetMinHeight($statusbar, 18)

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

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

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $ButtonLI

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

    Case $ButtonLO

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

    Case $Button1

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

    Case $Button2

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

    Case $Button3

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

    Case $Button4

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

    Case $Button5

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

    Case $Button6

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

    EndSwitch
    WEnd

    [/autoit]

    Danke im vorraus.

    MfG Herr Bert

    Einmal editiert, zuletzt von Herr Bert (13. August 2013 um 11:54)

  • Ja, mithilfe von

    [autoit]

    GUICtrlSetState($idButton, $GUI_DISABLE)
    ; bzw.
    GUICtrlSetState($idButton, $GUI_ENABLE)

    [/autoit]


    Genaueres kannst du ja in der Hilfe nachlesen.

    MfG

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski