|
-
Feb 18th, 2010, 08:01 AM
#1
Thread Starter
Lively Member
For Cycle in pause for some seconds
Hello,
I have a loop and I need that at the end of each step of the cycle that it sets in pause for a few seconds
How?
-
Feb 18th, 2010, 08:18 AM
#2
Re: For Cycle in pause for some seconds
You could call Thread.Sleep, but that's going to lock up the app. It would be better not to use a loop at all, but rather use a Timer with an Interval of 2000 (milliseconds) and then execute one iteration in the Tick event handler.
-
Feb 18th, 2010, 09:52 AM
#3
Thread Starter
Lively Member
Re: For Cycle in pause for some seconds
thanks for the help,
i'm tryng with create a thread and then put it on sleep
the calling is done in this way
vb Code:
Dim t As Thread t = New Thread(AddressOf Me.threadtDo) t.Start()
but from thread i try to do some operations and it gives me an error "cross-thread" ,
becouse i invoke from that thread some form components...
how i can solve this problem??
-
Feb 18th, 2010, 07:17 PM
#4
Re: For Cycle in pause for some seconds
Follow the CodeBank link in my signature and check out my Accessing Controls From Worker Threads post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|