Hi,
I just started using Xojo today and I want to make a Progress bar for a splash screen I’ve created.
I make a timer and I put this code inside the ‘Action’ event handler:
for i As Integer = 1 To 10
frmSplash.ProgressBar1.Value=i*10
'wait a second?
next
I’m not sure how to make the timer wait a second so that it takes 10 seconds to load?
Thanks in advance.
That’s backwards. All you’d want in the timer’s Action event is:
frmSplash.ProgressBar1.Value=frmSplash.ProgressBar1.Value + 1
if frmSplash.ProgressBar1.Value = frmSplash.ProgressBar1.Maximum then me.mode = 0
Then you’d set the timer’s period
to one second (1000). Then timer would then be triggered once every second. Each time it would advance the progressbar by 10% (assuming frmSplash.ProgressBar1.Maximum = 10
).
The second line of code would turn off the timer one it reaches the maximum. You might also want to add a line of code there that would close the window (if this is for a splash screen).