JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Creating Progress Bars

The primary properties of progress bars, much like scroll bars, are Minimum, Maximum, and Value. Here's an example, ProgressBars on the CD-ROM, where I use a timer to steadily increment the Value property of ProgressBar1, having already set the Minimum and Maximum properties. The action starts when the user clicks a button labeled Start that enables the timer:

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Timer1.Tick
    ProgressBar1.Value += 1
    If ProgressBar1.Value = ProgressBar1.Maximum Then
        Timer1.Enabled = False
    End If
End Sub

You can see this example at work in Figure 10.6.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor