Jump to content
Sign in to follow this  

progress bar acting funny

Recommended Posts

for some reason this works, but doesn't feel right, it should add 10 each time but the first time you run it and hit the button it jumps to 20 and then it works normal and then after a couple clicks it jumps again and it doesn't seem to be working fast enough either, am I doing something wrong.

#include <GUIConstants.au3>
$gui = GUICreate("", 100, 65)
$lvl = GUICtrlCreateLabel("0", 0, 0, 36, 17)
$exp = GUICtrlCreateLabel("10", 80, 0, 36, 17)
$bar = GUICtrlCreateProgress(0 , 20 , 100 , 20)
$click = GUICtrlCreateButton("Click", 0, 40, 75, 25, 0)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
        Case $click
            If GUICtrlRead($bar) >= 100 Then
                GUICtrlSetData($lvl , GUICtrlRead($lvl) +1)
                GUICtrlSetData($bar , 0)
                GUICtrlSetData($bar , GUICtrlRead($bar) + GUICtrlRead($exp))

well I am at it is there away to stop enter from being pushed on the button besides checking for the enter as a hotkey such as a button style?

sorry the post isn't neat I got to run to school.

Edited by JellyFish666

Share this post

Link to post
Share on other sites

I have no problems, goes from 1-100 with 10 step and then goes from 1-100 again.

I have no idea why it's not working for you :)

oh no it works for me but it jumps sometimes to 20 instead of 10 (its lunchtime so can't fix it right now) and when I click it really fast it doesn't seem to update quickly I think there might be a better way to add it, my way is just the easy way.

guess progress bars are for only 100% I need to make a custom one.

Edited by JellyFish666

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  

  • Create New...