Click to See Complete Forum and Search --> : Status bar
MikeA
Jul 18th, 2000, 11:06 AM
I have tried to locate a status bar that allows customizing the color of each bar, I could not locate one.
Instead I am going to use several rectangle objects and then just show them at specified time. The goal is to create sort of a countdown effect.
I cannot figure out how to use the timer control in VB6 to make this happen. I.e. I have 20 boxes, they are all hidden by default. Then when a certain even is triggered, I want each box to show progressively in a certain time frame, say 5 seconds.
Any ideas on how to do this??
Thanks
Mike
dwhawley
Jul 19th, 2000, 01:24 PM
i have done something similar in the past. instead of revealing an image however, i triggered a chain of various events. the way i approached it was by inserting several timer controls onto the form and then enabling them in a certain sequence. it is important to note, that the timer control does not really measure when, but it measures how often. as an example, we'll use three timers (timer1-timer3) and three rectangles (shape1-shape3). just as you have already done, make sure that the rectangles are not visible by default. disable the timers by default as well and throw in a command button just for kicks.
Dim i As Integer
Private Sub Command1_Click()
Shape1.Visible = False
Shape2.Visible = False
Shape3.Visible = False
i = InputBox("Enter Time Interval")
Timer1.Interval = i
Timer2.Interval = i
Timer3.Interval = i
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Shape1.Visible = True
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Shape1.Visible = False
Shape2.Visible = True
Timer2.Enabled = False
Timer3.Enabled = True
End Sub
Private Sub Timer3_Timer()
Shape2.Visible = False
Shape3.Visible = True
Timer3.Enabled = False
End Sub
when you click the command button, you are asked to input a value which is set equal to each of the timers interval properties (note that 18 is roughly equal to 1 second). if you do not want a timer to continually run, you must disable it after it runs the first time. then, to keep the process going, enable the next timer. do this until the entire process has completed.
if you want to be a "mr. fancy pants" and create a quick and dirty progress bar (a status bar is the thing at the bottom of internet explorer that gives you all the messages such as "Web Site Found, Waiting for reply..." and the such), you can stick a normal progress bar onto your form (setting its visible property to false) and use the timer events to check its value which in turn you would use to update you progress bar.
Dougz999
Jul 20th, 2000, 04:01 PM
I think that you would be better Just Using One Timer Control. In its timer event have a statis variable, and make your Rectangles members of a control array.
You can then do something like this in the timer
static intval as integer
if isnull(intval) then static = 2 ' Set default value
Rectnangle(IntVal).visible = true
Rectangle(intval - 1)visible = false
intval = intval + 1
If static = 100 then timer1.enabled = false
Then start the timer when the countdown begins, the timer interval will specify how long each bar is shown for.
This means one timer control, and a lot less stress for your HEAD!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.