Ladebalkenwert per Button erhöhen?!?

  • also
    ich möchte das wenn ich ein knopf drücke der Ladebalken um "4" zum Beispiel weiter geht.

    Wie mache ich das?:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $Progress1 = GUICtrlCreateProgress(32, 336, 473, 97)
    $Button1 = GUICtrlCreateButton("+", 240, 120, 281, 41, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

    EndSwitch
    WEnd

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

    func set ()
    guictrlsetdata($progress1, +4)

    endfunc

    [/autoit]

    beim ersten mal klicken wird es zwar gesteigert, aber beim zweiten nicht mehr,. warum ist das so?

    Einmal editiert, zuletzt von aflakes (2. Februar 2011 um 23:36)

    • Offizieller Beitrag
    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $Progress1 = GUICtrlCreateProgress(32, 336, 473, 97)
    $Button1 = GUICtrlCreateButton("+", 240, 120, 281, 41, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

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

    Func set()
    GUICtrlSetData($Progress1, GUICtrlRead($Progress1) + 4)

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

    EndFunc ;==>set

    [/autoit]

    Hilfe lesen, dann kann man das auch selbst lösen.

  • Hallo aflakes,

    du weist jedesmal den Wert 4 zuweist, sieht man natürlich keinen Unterschied. Mach es so:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $Progress1 = GUICtrlCreateProgress(32, 336, 473, 97)
    $Button1 = GUICtrlCreateButton("+", 240, 120, 281, 41, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

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

    func set ()
    guictrlsetdata($progress1, GUICtrlRead($progress1)+4)

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

    endfunc

    [/autoit]

    mfg autoBert