23-03-13, 03:00 PM
تفضل اخى
كود :
Dim stopp As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'\\\\تشغيل التايمر
stopp = True
Dim trd As New System.Threading.Thread(AddressOf tick_timer)
trd.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'\\\ ايقاف التايمر
stopp = False
End Sub
Private Sub tick_timer()
While stopp = True
System.Threading.Thread.Sleep(1500)
If stopp = False Then
Exit Sub
End If
MsgBox("it work")
End While
End Sub