Answers
May 01, 2007 - 08:32 AM
eg
Timer myTimer = new Timer();
myTimer.Elapsed += new ElapsedEventHandler( DisplayTimeEvent );
myTimer.Interval = 1000;
myTimer.Start();
'do stuff
and the function that has been defined above can be coded like this
public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
{
Console.Write("\r{0}", DateTime.Now);
}
Now Im thinking a infinite loop but not sure how you track mouse movements or keypresses
May 01, 2007 - 08:35 AM
But I got this link which may help you capture mouse movements, so that u can come out the loop that u have after your timer definiton, hope this helps http://www.codeproject.com/csharp/Glo...
May 01, 2007 - 12:17 PM
This leaves your form which runs on the main thread responsive without having to do mouse event trapping etc.
If you need to capture an event from your routine on the separate thread,use callback functions.
Here are a couple of links and tutorials:
http://www.c-sharpcorner.com/UploadFi...
http://www.codersource.net/csharp_tut...
http://www.yoda.arachsys.com/csharp/t...
http://www.c-sharpcorner.com/UploadFi...
Hope this helped
Cheers
Peter
Jun 03, 2007 - 10:37 PM
Peter, your solution was the one I was looking for...
Nov 19, 2007 - 01:27 PM
Threading.Thread.Sleep(Time)
here time is in milli seconds
If you want some thing like implementing progress bar while retrieving data let me know
- Rajavardhan Sarkapally
Add New Comment