|
|
|||
|
Basics More Complex Examples
|
Link progress bar with timer in vb.netBasic Controls with Visual Basic 2008
The primary use of a ProgressBar is to show process progress. The
ProgressBar's Style attribute can be set to either Blocks, Continuous or
Marquee. We will build a small example to demonstrate how they work.
Start by creating a new project. From the Toolbox menu create the
following controls on the form: Now space the controls on the form as in the example Figure 8.
Lets change the necessary attributes in the forms Load handling event instead of going to each individual attribute list. Double click on the form to change its load event and on Timer1 to change its tick event. We are going to link the progress bar with the timer event in vb.net. The end result in the Code View should look like the following. Public Class Form1
When u set a ProgressBar's Style to
Marquee it will run continuously. The Timer event is set to occur every
100 milliseconds, which is configured in the Interval attribute. One
second = a Value of 1000. In the forms load event we set ProgressBar2's
.Step value to one. I determines the amount of increase that will occur
at a time. The Integer called MyProgress increases itself with one every
time Timer1 ticks. The label will add "%" to MyProgress in order to
read, "File Upload = ?%". When MyProgress's value reaches 100 the label
will change to "Complete" and ProgressBar1 will disappear.
Email us at: info@pro2visual.com
|
Popular Articles Moving a borderless form in vb.net Link Progress Bar with Timer in vb.net How to open a folder using the process control |
|
|
|