jiji muy bien muchas gracias bueno dejo el codigo traducido al VB.NET
Código VB.NET:
Ver originalImports System.Threading
Public Class Form6
Private Delegate Sub Timer(ByVal timer
As String) Private timer1 As Timer
Private time As Double = 0.0
Private timerStarted As Boolean = False
Private returnTime As String = String.Empty
Private Sub UpdateTimer(ByVal time As String)
Me.lblTimerDisplay.Text = time
End Sub
Public Function Counter() As String
Return returnTime
End Function
Private Sub DisplayTimer()
Do While timerStarted
time += 0.01
time = Convert.ToDouble(time.ToString("0.00"))
returnTime = Convert.ToString(time)
Me.lblTimerDisplay.Invoke(timer1, Counter)
Loop
End Sub
Public Sub New()
' Llamada necesaria para el Diseñador de Windows Forms.
InitializeComponent()
timer1
= New Timer(AddressOf UpdateTimer
)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim starTimer As New System.Threading.Thread(AddressOf DisplayTimer)
timerStarted = True
starTimer.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
timerStarted = False
End Sub
End Class