Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27511

How can I fix this?

$
0
0
This is my code for my timer
Code:

        For Each Item In ListBox1.Items
            Threading.Thread.Sleep(TextBox2.Text * 1000)
            SendKeys.Send(Item)
            SendKeys.Send("{Enter}")
        Next

If i press go, it will say each line in the listbox one at a time with a certain interval in between each message. However, if I have a few lines like THIS

Code:

Lol
Noob
Rofl

And I press go.. It will say "Lol", "Noob", "Rofl" BUUUUTTTT!!!

If I STOP the timer in the middle of it typing all of the messages it will ONLY stop once the last message is complete, how do I make it so the timer will stop as soon as I press it and it wont complete saying the messages???

Viewing all articles
Browse latest Browse all 27511

Trending Articles