Home » VB.NET ProgressBar Control

VB.NET ProgressBar Control

by Online Tutorials Library

VB.NET ProgressBar Control

The Window ProgressBar control is used by the user to acknowledge the progress status of some defined tasks, such as downloading a large file from the web, copying files, installing software, calculating complex results, and more.

Let’s create a ProgressBar by dragging a ProgressBar control from the toolbox and dropping it to the Windows form.

Step 1: The first step is to drag the ProgressBar control from the toolbox and drop it on to the Form.

VB.NET ProgressBar Control

Step 2: Once the ProgressBar is added to the Form, we can set various properties of the ProgressBar by clicking on the ProgressBar control.

Properties of the ProgressBar Control

There are following properties of the VB.NET ProgressBar control.

Property Description
BackgroundImage The BackgroundImage property is used to set the background image in the progressbar control.
MarqueeAnimationSpeed It is used to determine the progress status for a progress bar in milliseconds.
Padding The padding property is used to create a space between the edges of the progress bar by setting the value in the progressbar control.
Step It is used to get or set a value in control that calls the PerformStep method to increase the current state of the progress bar by adding a defined step.
Maximum It is used to set the maximum length of the progress bar control in the windows form.
Minimum It is used to set or get the minimum value of the progress bar control in the windows form.
AllowDrop It obtains a value representing whether the progress bar control enables the user to be dragged onto the form.
Style It is used to set a value that represents how types the progress bar should be displayed on the Windows Form.

Methods of the ProgressBar Control

Event Description
ForeColor The ForeColor method is used to reset the forecolor to its default value.
ToString The ToString method is used to display the progress bar control by returning the string.
Increment It is used to increase the current state of the progress bar control by defining the specified time.
PerformStep The PerformStep method is used to increase the progress bar by setting the step specified in the ProgressBar property.

Events of the ProgressBar Control

Events Description
Leave The Leave event occurs when the focus leaves the progress bar control.
MouseClick A MouseClick event occurred when the user clicked on the progress bar control by the mouse.
BackgroundImageChanged When the background property changes to the progress bar control, the BackgroundImageChanged event changes.
TextChanged It occurs when the property of the text is changed in the progress bar control.
PaddingChanged It occurs when the padding property is changed in the progress bar control.

Furthermore, we can also refer to VB.NET Microsoft documentation to get a complete list of ProgressBar control properties, methods, and events in the VB.NET.

Let’s create a program to display the progress status in the VB.NET Windows form.

Progressbr.vb

Output:

VB.NET ProgressBar Control

Click on the Show button to display the progress status at run time in Windows Form.

VB.NET ProgressBar Control

And when the progress status reaches the progress bar’s maximum value, it displays the following message.

VB.NET ProgressBar Control


Next TopicScrollBars Control

You may also like