Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi
i am newbie of this .Net world so i am facing so many problem here is one of them,I want to resume my backgroundWorker after made it pause so how can i do it(In Windows Form) please help me.
 
Thanks in Advance..
Posted 12-Apr-12 0:01am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you need a working demo application you can find it here. The code can be downloaded from GitHub
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Pause / Resume operations are realized with WaitHandles, e.g. the ManualResetEvent:
 
ManualResetEvent continueEvent = new ManualResetEvent(true);
 
continueEvent.WaitOne(); //This should call the background thread every then and now

continueEvent.Reset(); //If this is called within an other thread, the thread will pause on continueEvent.WaitOne()

//until
continueEvent.Set() // is called
 
(Source[^], but please google yourself the next time)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 278
1 Maciej Los 205
2 Nguyen.H.H.Dang 190
3 arvind mepani 187
4 Peter Leow 180


Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid