|
-
Oct 27th, 2001, 05:42 PM
#1
Thread Starter
Lively Member
Progress Bar and Timer
I've never used a progress bar before so
I need some help coding the below:
- I want a progress bar on the bottom of my program to increase as time continues.
So with a timer maybe I could do this; at 5 seconds the progress bar be about 1/4 complete, at 10 seconds, half complete, 15 seconds, 3/4 complete, 20 seconds fully complete, then have it reset but not start over. I don't want the progress to be choppy though, just a smooth line to the end.
Help? Thanks
JoshK
[email protected]
-
Oct 27th, 2001, 05:48 PM
#2
-= B u g S l a y e r =-
VB Code:
Option Explicit
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
If Me.ProgressBar1.Value = Me.ProgressBar1.Max Then
Me.ProgressBar1.Value = 0
Timer1.Enabled = False
Else
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
End If
End Sub
adjust the timer as needed
-
Oct 27th, 2001, 05:55 PM
#3
Thread Starter
Lively Member
Exactly what I was looking for 
Thanks pete!
JoshK
[email protected]
-
Oct 27th, 2001, 06:01 PM
#4
-= B u g S l a y e r =-
glad I could help Josh
-
Oct 27th, 2001, 08:04 PM
#5
New Member
quick question
what's the "option explicit" thing you used mean? i'm fairly new to vb so i don't know all the commands yet, but i've programmed in other languages before
-
Oct 27th, 2001, 08:23 PM
#6
Option Explicit will help you to find undeclared variable and will cause less error.
try to run a program without declaring your variable with Option Explicit you will got an error.
For more detail you should read MSDN help
-
Oct 27th, 2001, 08:26 PM
#7
So Unbanned
Option Explicit requires you to Dim, Public, Private, Global, etc. every varible or it'll be errored.
Can be annoying at times... but some people like it.
-
Oct 27th, 2001, 08:28 PM
#8
Yes that what I said you need to declare your variable with Option Explicit
-
Oct 28th, 2001, 02:57 AM
#9
-= B u g S l a y e r =-
ALWAYS use Option Explicit !
-
Oct 28th, 2001, 03:05 AM
#10
PowerPoster
Originally posted by peet
[B] ALWAYS use Option Explicit !
Always use Option Explicit but never use the Progress bar control unless u are using lots of other controls from the same OCX.. u can quite easily build ur own control with minimal overhead.
http://www.vbforums.com/showthread.p...hreadid=114422
Regards
Stuart
-
Oct 28th, 2001, 03:07 AM
#11
PowerPoster
PS Peet Repeet.. i see that u have Auto Syntax Check on. That thing bugs the hell out of me... i much prefer just ot have colour coding instead of constant reminders.. stoopit thing
-
Oct 28th, 2001, 03:14 AM
#12
-= B u g S l a y e r =-
-
Oct 28th, 2001, 03:21 AM
#13
-
Oct 28th, 2001, 03:37 AM
#14
Frenzied Member
ya that would be nice to have something like that
-
Oct 28th, 2001, 03:54 AM
#15
-= B u g S l a y e r =-
Originally posted by beachbum
Mr Pinnochio, I can scratch ur nose from my balcony!!! 
Hey Peet, just on the same thing with vb settings. I remember reading about a registry setting that would ensure that any open code modules / forms etc would open up in their maximized state when u first started VB.. do you know about this? Do u use it? have it etc?
uh.. no .. sorry
-
Oct 28th, 2001, 11:30 AM
#16
I hate the Ding song when I do move a part of a code an it broke a condition but I have never checker in the Option to take off the check. Thx for the tip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|