Software Engineer, Equity Strategist, Polymath.
Progress Bar Sample Code (VB NET 2008)
Picture Info:
—————————–
(A) Progress Bar, Properties :
Name = ProgressBar1
Minimum (value) = 0
Maximum (value) = 100
(B) Button, Properties :
Name = Button1
Text = Button1
(C) Timer, Properties:
Name = Timer1
Enabled = False
Interval = 100
Kode (F7) :
—————-
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Timer1.Tick
Static TikTok As Integer
TikTok = TikTok + 1
ProgressBar1.Value = TikTok
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Enabled = False 'deactivate Timer1
TikTok = 0 'set static value back to 0
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click
Timer1.Enabled = True 'activate Timer1
Timer1.Interval = 100 'set interval to 100
ProgressBar1.Value = 0 'set ProgressBar value to 0
End Sub
End Class
This entry was posted by Ray Tawil on February 16, 2010 at 10:26 am, and is filed under Visual Basic.Net. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site.
Leave a Reply
You must be logged in to post a comment.