Hi All,
I am creating a programming that is sending info for one pc to another over RF. The desktop show create a xml file. It writes some of the info but not all. I receive a Target Invocation Exception Error.
I realize I need to slow down the incoming Data. I want to use a timer to slow it down.
Does anyone know how to do this?
Delay in VB.netUsing timer to slow down code
Page 1 of 1
4 Replies - 15286 Views - Last Post: 19 February 2009 - 12:07 PM
Replies To: Delay in VB.net
#2
Re: Delay in VB.net
Posted 13 January 2009 - 12:44 PM
The following code will pause the currently running thread of your application to pause for 1000ms which is 1 second.
System.Threading.Thread.Sleep(1000)
#3
Re: Delay in VB.net
Posted 19 February 2009 - 11:52 AM
AdamSpeight2008, on 13 Jan, 2009 - 11:44 AM, said:
The following code will pause the currently running thread of your application to pause for 1000ms which is 1 second.
System.Threading.Thread.Sleep(1000)
hello i tried this but the UI becomes unreponsive i hope i can find something better
thanks anyway
#4
Re: Delay in VB.net
Posted 19 February 2009 - 12:03 PM
In most case thats the UI thread.
So use a separate thread for the calculation part of your program, then use delegates to update the UI.
So use a separate thread for the calculation part of your program, then use delegates to update the UI.
#5
Re: Delay in VB.net
Posted 19 February 2009 - 12:07 PM
as adam was saying u need to use another thread. so research the backgroundworker and it should get you on the right track. the backgroundworker is an easy way of creating a new thread.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote






|