ProgressBar Control

The ProgressBar control visually indicates the progress of a lengthy operation such as calculating a complex result, downloading a large file from the Web etc.

vb.net-progressbar.jpg

The Maximum and Minimum properties define the range of values to represent the progress of a task.

  Minimum : Sets the lower value for the range of valid values for progress.
  Maximum : Sets the upper value for the range of valid values for progress.

Value : This property obtains or sets the current level of progress.

By default, Minimum and Maximum are set to 0 and 100. As the task proceeds, the ProgressBar fills in from the left to the right. To delay the program briefly so that you can view changes in the progress bar clearly.

The following VB.Net program shows a simple operation in a progressbar .




Public Class Form1
	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

		Dim i As Integer

		ProgressBar1.Minimum = 0
		ProgressBar1.Maximum = 200

		For i = 0 To 200
			ProgressBar1.Value = i
		Next

	End Sub
End Class

 VB.Net GUI - Related Contents



.