Hey Youtube.. Follow me @Ashutoshbsharma :)
You also need a timer in your project... :)
not able to put some signs here...so read the code once :)
comment :)
=========codes==============
EXIT BUTTON========
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
=====================
START BUTTON=========
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Start()
Button3.Enabled = False
Button4.Enabled = True
TextBox1.Enabled = False
End Sub
========================
TIMER===================
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim r As VariantType
For i = 5 To 10
r = Rnd(i)
ProgressBar1.Increment(r)
Next i
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
MsgBox("Completion! :) ", MsgBoxStyle.Information, vbOKOnly)
If vbOKOnly = MsgBoxStyle.OkOnly Then
Button4.Enabled = False
Button3.Enabled = True
End If
End If
End Sub
===========================
FORM LOAD=================
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button4.Enabled = False
TextBox1.Enabled = False
End Sub
===========================
STOP BUTTON================
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer1.Stop()
Button3.Enabled = True
Button4.Enabled = False
End Sub
============================
MANUAL VALUE BUTTON=========
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
Else
If TextBox1.Text (grater than ) 100 Then
MsgBox("Error,You Can Enter Numbr From 1 TO 100", MsgBoxStyle.Critical, "Error")
Else
ProgressBar1.Value = TextBox1.Text
End If
If ProgressBar1.Value = 100 Then
MsgBox("Completion! :) ", MsgBoxStyle.Information, "Completion! :) ")
Timer1.Stop()
End If
End If
TextBox1.Enabled = True
End Sub
End Class
En esta página del sitio puede ver el video en línea Simple Progress Bar Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario Ashutosh Bhaskar Sharma 01 noviembre 2011, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2,165 veces y le gustó 3 a los espectadores. Disfruta viendo!