Progress (Fortschritt) leiste

  • Sooo,

    ich habe hier mal ein easy Script, für nen Progress, also ne coda mitm progress drin!

    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 633, 447, 189, 121)
    $Progress1 = GUICtrlCreateProgress(192, 184, 150, 17)
    $Button1 = GUICtrlCreateButton("Button1", 88, 64, 161, 73, $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

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

    Case $Button1
    ;ja, hier soll nun innerhalb von 10 sec die Progress durchlaufen ^^

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

    EndSwitch
    WEnd

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

    Also, ich möchte dass die Progress leiste sich innerhalb von 10 sekundn füllt!

    MFG elitemattthias

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Gibt viele Möglichkeiten - hier mal eine:

    Spoiler anzeigen
    [autoit]

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

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

    $GUI = GUICreate("", 633, 447, 189, 121)
    $Progress1 = GUICtrlCreateProgress(192, 184, 150, 17)
    $Button1 = GUICtrlCreateButton("Button1", 88, 64, 161, 73, $WS_GROUP)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $Timer = TimerInit()
    Do
    GUICtrlSetData($Progress1, TimerDiff($Timer) / 100)
    Until TimerDiff($Timer) > 10000
    EndSwitch
    WEnd

    [/autoit]
  • hier eine andere
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 633, 447, 189, 121)
    $Progress1 = GUICtrlCreateProgress(192, 184, 150, 17)
    $Button1 = GUICtrlCreateButton("Button1", 88, 64, 161, 73, $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
    For $i = 1 To 100 Step 1
    GUICtrlSetData($Progress1, $i)
    Sleep(100)
    Next
    EndSwitch
    WEnd

    [/autoit]
  • Hallo elitemattias,

    und hier noch eine andere:

    Spoiler anzeigen
    [autoit]

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

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

    Global $iDone = 0

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

    $GUI = GUICreate("", 633, 447, 189, 121)
    $Progress1 = GUICtrlCreateProgress(192, 184, 150, 17)
    $Button1 = GUICtrlCreateButton("Button1", 88, 64, 161, 73, $WS_GROUP)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $iDone = 0
    GUICtrlSetState($Button1,$gui_Disable)
    AdlibRegister("_progress",100)
    EndSwitch
    WEnd

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

    Func _progress()
    $iDone += 1
    GUICtrlSetData($Progress1, $iDone)
    if $iDone = 100 then
    AdlibUnRegister("_progress")
    GUICtrlSetState($Button1,$gui_Enable)
    EndIf
    EndFunc

    [/autoit]

    mfg (Auto)Bert