Post[Help]Thread.Sleep alternative[Solved]

Posts 16–22 of 22 · Page 2 of 2
My code works fine for me
Quote Originally Posted by NextGen1 View Post
My code works fine for me
And me.

I replaced all my previous sleeps with your code :]
I replaced all my previous sleeps with your code
That's Awesome
your code work.

but still freeze whole thing.

when the sleep do its job ( 3 sec ) we cant move the form that mean it still freeze the main thread

after the 3 sec we can move it.

so for me its useless

thanks btw for making this to show
Application.doevents prevents freezing of application that is, there are a few advanced options, I will pluck around and see if I can use another method

OK,


ok i found a way to do what i need.

when i press the button the txtWords text become " haha " , wait 2 second.
my timer generate number to textbox1 interval 200ms WITH NO FREEZE !

the form freeze , but the rest keep working.

thank you for helping me.

if you wasnt there , i couldnt get it working

you're the man !
Quote Originally Posted by l4sth4ck3r View Post
ok i found a way to do what i need.

when i press the button the txtWords text become " haha " , wait 2 second.
my timer generate number to textbox1 interval 200ms WITH NO FREEZE !

the form freeze , but the rest keep working.

thank you for helping me.

if you wasnt there , i couldnt get it working

you're the man !
i cant find the edit button sorry

here the code i forgot to post


Code:
Dim timeOut As DateTime = Now.AddMilliseconds(2000)

        Do

            txtWords.Text = "haha"

            Application.DoEvents()

            'Keep looping until the elasped time of 2000 milliseconds.

        Loop Until Now > timeOut

        MsgBox("The code paused for: 2000 Milli-Seconds or 2 Seconds!")
Posts 16–22 of 22 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?