Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > Forms sample source codes
Use of the ProgressBar Control
Use of the ProgressBar Control 'using the progressbar 'make a new form with a progressbar and a timer 'put thew folowing code in the events Private sub Form_Load() Me.Show Timer1.Interval = 1000 Timer1.Enabled = True End Sub Private sub Timer1_Timer() PauseTime = 5 ' set duration. ProgressBar1.Max = ((PauseTime + 1) * Timer1.Interval) start = timer ' set start time. do While timer < start + PauseTime ProgressBar1.Value = ProgressBar1.Value + 10 DoEvents ' Yield to other processes. Loop Finish = timer ' set end time. TotalTime = Finish - start ' Calculate total time. MsgBox "Paused for " & TotalTime & " seconds" Timer1.Enabled = False End Sub Return
Privacy Policy
|
Link to Us
|
Links