[Help]Pausing a loop?[solved]

Posts 1–6 of 6 · Page 1 of 1
[Help]Pausing a loop?[solved]
Is it possible to just flat out pause in the middle of a loop so you can type something in a textbox and when u click a button the loop continues?

If not is it possible to make some sort of function that will wait like 7 seconds in the middle of a loop to let you type and after the 7 seconds the loop keeps on going?
if herethestuff that started
pause
on a button?
or to simple? xd
Quote Originally Posted by lolbie View Post
if herethestuff that started
pause
on a button?
or to simple? xd
what are u talking about?
Threading.thread.sleep(millisecs)
Is prolly what you're looking for.
(1000 millisecs = 1sec)

but the problem is that the program will be unresponsive unless you know multithreading which seems very unlikely

check out the Code Snippets post, theirs a better sleep func. in there.
my way

Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Text = 7
        Timer1.Interval = 1000
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Text -= 1
        If Label1.Text = 0 Then
            Timer2.Start()
            Timer1.Stop()
            Exit Sub
        End If
    End Sub
Timer2 = your loop btw

it's a way (easiest) lol
basically solved. Thanks
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?