Results 1 to 2 of 2

Thread: Status bar

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    3
    Original message posted to wrong forum....


    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
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    I assume that your boxes are Shape controls. Make a control array out of your boxes. With a control array they will all have the same name and a unique index, e.g. myBox(0), myBox(1), myBox(2) up to myBox(19). Then add a timer and put its interval to 5000.

    Then declare a boolean variable and set its value to False in the Form_Load routine. When you want to show the progress bars, change the value to true.

    The timer code would be something like this:

    Code:
    Private Sub Timer1_Timer()
    
    If eventTriggered = False Then
         Exit Sub
    End if
    
    For i = 0 to 19
         If myShape(i).Visible = False Then
              myShape(i).Visible = True
              Exit Sub
         End If
    Next
    
    eventTriggered = False
    
    End Sub

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