PC Review


Reply
 
 
matt chuningham via .NET 247
Guest
Posts: n/a
 
      16th Mar 2005
Hi there..I have a troublesome problem. I have a class, that isprocessing a specific task. At any specific moment a customevent is fired so that I could view the info generated in theinterface. Now, I need some sort of mechanism that would haltthe whole thing for 2 seconds and after resumes normally. Itried out Thread.Sleep(2000) but it failed, I used a timer withthe tick event but no halting took place! Can any body help outplease?

--------------------------------
From: matt chuningham

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>L0kGXtumyUqnHJvAhDVEwA==</Id>
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJpYW4gS2VhdGluZw==?=
Guest
Posts: n/a
 
      16th Mar 2005
howdy,
guess ur talking about window forms timer!?
if so doing a sleep in the handler function will block ur gui,
so best option is to have second timer (resumetimer)

so do something like

maintimer_ontick(..)
{
... do stuff
maintimer.stop(); // or maintimer.eneabled = false;
resumetimer.start();
}


resumetimer_ontick(...)
{
maintimer.start();
resumetimer.stop();
}


"matt chuningham via .NET 247" wrote:

> Hi there..I have a troublesome problem. I have a class, that is processing a specific task. At any specific moment a custom event is fired so that I could view the info generated in the interface. Now, I need some sort of mechanism that would halt the whole thing for 2 seconds and after resumes normally. I tried out Thread.Sleep(2000) but it failed, I used a timer with the tick event but no halting took place! Can any body help out please?
>
> --------------------------------
> From: matt chuningham
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>L0kGXtumyUqnHJvAhDVEwA==</Id>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timers Earl Partridge Microsoft VB .NET 19 25th Apr 2008 11:24 PM
System.Timers.Timers + WindowsService Björn Microsoft Dot NET Framework 5 17th Jan 2006 02:08 PM
Timers in .NET Ashish Sheth Microsoft Dot NET Framework 2 25th Aug 2004 03:47 PM
RE: Timers not fireing System.Windows.Forms.Timer and System.Timers.Ti =?Utf-8?B?UmljaE0=?= Microsoft Dot NET Framework Forms 3 19th Aug 2004 10:35 AM
Timers Senthil Kumar Microsoft ASP .NET 6 25th Dec 2003 10:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.