Soy un novato y estoy aprendieno a programar en VB 2012. Necesito ayuda con lo sigunete:
Quiero agreagar un progressbar a mi programa para que se llene dependiendo en cuantos segundos faltan para que llege al valor ingreso en un TextBox. El Valor ingreso en un text box es comparado con un valor de un timer (cronometro) . Mi codigo abajo:
-----------------------------------------------------
Public Class Form1
Private hour As Integer = 0
Private minute As Integer = 0
Private second As Integer = 0
Public Sub show_time()
second += 1
If second = 59 Then
second = 0
minute += 1
If minute = 59 Then
minute += 1
hour += 1
End If
End If
Label3PrgressStdPC.Text = hour.ToString.PadLeft(2, "0") & ":"
Label3PrgressStdPC.Text &= minute.ToString.PadLeft(2, "0") & ":"
Label3PrgressStdPC.Text &= second.ToString.PadLeft(2, "0")
Label3PrgressStdPC.Refresh()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
show_time()
TextBox1.SelectedText = TextBox1.Text
If TextBox1.SelectedText = Label3PrgressStdPC.text Then
Timer1.Stop()
MsgBox("time is up")
End If
End Sub
Private Sub Bn_start_St01_Click(sender As Object, e As EventArgs) Handles Bn_start_St01.Click
Timer1.Start()
Timer2.Start()
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
End Sub
Private Sub ProgressBar1_Click(sender As Object, e As EventArgs) Handles ProgressBar1.Click
ProgressBar1.Maximum =???????????????????
ProgressBar1.Minimum = 0
Timer2.Interval = 1000
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
ProgressBar1.Value = val
val = ????????????????????????
If (?????????? = ???????????) Then
Timer2.Stop()
End If
End Sub
End Class
--------------------------------------------------------------------
Sugerencias ?
Muchas Gracias