Results 1 to 3 of 3

Thread: Status bar

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    3
    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

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Posts
    88

    Lightbulb

    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.

  3. #3
    New Member
    Join Date
    Jul 2000
    Location
    UK Essex
    Posts
    12
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width