When developing any application, communicating timely information to the user is a requirement. When an event or processing takes time, a user may become impatient and stop the program. A progress bar, or load bar, provides information to the user on what is occurring. Common uses for the load bar include intense computations, download of network data or writing a file. The progress bar control is provided with the .NET framework from Microsoft.
- Skill level:
Open Visual Basic from the "Start" icon on the Windows taskbar.
Press the "Control" and "N" keys to open a new project window. Select "Windows Forms Application" and click "OK."
Click the "ProgressBar" icon located in the ToolBox window. Draw a progress bar in the Form 1 window.
Double-click the "Button" icon located in the ToolBox window to display a button in the Form 1 window.
Double-click "Button1" to open the code window. Insert the following code:
Dim x As Integer
For x = 1 To 100 ProgressBar1.Value = x x = x + 1 Next
Press the "F5" key to start the application in debug mode. Click on "Button1" to execute the code looping from 1 to 100. The progress bar displays the progress of the loop.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for