L15-C2 Progress Bar Control
L15-C2 Progress Bar Control
The main properties of a progress bar are Value, Maximum and Minimum.
The Minimum and Maximum properties are used to set the minimum and
maximum values that the progress bar can display. The Value property
specifies the current position of the progress bar.
The ProgressBar control is typically used when an application performs tasks
such as copying files or printing documents. To a user the application might
look unresponsive if there is no visual cue. In such cases, using the
ProgressBar allows the programmer to provide a visual status of progress.
Example1:
create a progress bar at runtime. Let's double click on the Form and
put the follow code in the opened window.
Public Class Form1
'set position
'set values
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 200
ProgressBar1.Value = 130
ProgressBar2.Minimum = 0
ProgressBar2.Maximum = 100
ProgressBar2.Value = 40
'add the progress bar to the form
Me.Controls.Add(ProgressBar1)
Me.Controls.Add(ProgressBar2)
Me.Text = "tutorialspoint.com"
End Sub
End Class
When the above code is executed and run using Start button
available at the Microsoft Visual Studio tool bar, it will show the
following window:
Expermint2:
Next
End Sub
End Sub
End Clas
Example 3:
Public Class Form1
Label_value.Text = ProgressBar1.Value
End Sub
End Sub