Hello,

I have a progress bar. I count backwards from 100 to 0. When the bar hits 0, Id like to reduce a variable by one. So far, all I have done is make it reduce 1 everytime the progress bar goes down.

Can anyone help?

I didnt post code because its written in C, but its the same principle here :)


Torch
Posted on 2001-09-11 22:07:34 by Torch
from what i remember,

progress bar can be initialized to an integer as maximum value.
Then, on a Your particular event, you send a number to the progressbar to set the actual progress bar position.

Just check the number you're passing to progressbar (seems you already doing it). When it's equal to zero decrease of one the variable you need.

example:

create:
call SendDlgItemMessage, hDlg, 5001, PBM_SETRANGE, 0, 0B400000h ; B40 = 2880
jmp Out

yourevent:
dec YourCurrentValue

call SendDlgItemMessage, hDlg, IDofProgressBarControl, PBM_SETPOS, YourCurrentValue, 0

cmp YourCurrentValue,0
jne Out
dec YourVariable
Out: ret

good luck
A
Posted on 2001-09-12 17:10:07 by Bit7