0

Hi guys......
My problem is....
If we write some lines of code in button click event......
How to set the sleeping timer
means.....
For eg----
Suppose we wrote 10 line of code in button click event....
After the exicution of first 5 lines of code,,, remaining 5 lines of code should be exicute after 5 seconds of first 5 lines of exicution....
How can i do that......
Somebdy plz help me
our school project is struck in the middle.......
Plz help me

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by roshu10
0

Just wondering; do the lines have to be in the Button's.Click event or can they be in separate Subs?as:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        someCoolSub()
        someOtherCoolSub()
    End Sub
    Private Sub someCoolSub()
        MsgBox("someCoolSub")
    End Sub
    Private Sub someOtherCoolSub()
        MsgBox("someOtherCoolSub")
    End Sub

Reason I'm asking is because you can use the Threading.Thread.Sleep , although that will freeze your entire application for 5 seconds, not just pause the the time between running the rest of the lines of code.

Edited by codeorder: n/a

0

thx for help......
bt i tried....
i cant use threadding.thread.sleep()
bcz its not working in button click event

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.