samir198811
New member
- Joined
- Aug 20, 2015
- Messages
- 1
- Programming Experience
- 5-10
Hi
I am new to this forum.
kindly I need help.
I have a vb.net form+button+textbox + delay sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''DELAY SUB'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub Delay(ByVal Milliseconds As Integer)
Dim Stop_Watch_2 As New Stopwatch
Stop_Watch_2.Start()
Do
Loop Until Stop_Watch_2.ElapsedMilliseconds >= Milliseconds
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For i = 1 To 10
Delay(2000) ' 2 second delay
Text_Box1.text = i.ToString
Button1.Left = Button1.Left + 30
Next
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
when I run the form , I can see the button is moving to left OK every 2 seconds, the button moving on delay OK , BUT the text is not taking the loop value ?!!!
this delay method for me is better than thread.Sleep
so any suggestions how to let the text box update its content after the delay interval ?
I am new to this forum.
kindly I need help.
I have a vb.net form+button+textbox + delay sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''DELAY SUB'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub Delay(ByVal Milliseconds As Integer)
Dim Stop_Watch_2 As New Stopwatch
Stop_Watch_2.Start()
Do
Loop Until Stop_Watch_2.ElapsedMilliseconds >= Milliseconds
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For i = 1 To 10
Delay(2000) ' 2 second delay
Text_Box1.text = i.ToString
Button1.Left = Button1.Left + 30
Next
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
when I run the form , I can see the button is moving to left OK every 2 seconds, the button moving on delay OK , BUT the text is not taking the loop value ?!!!
this delay method for me is better than thread.Sleep
so any suggestions how to let the text box update its content after the delay interval ?