Click here to Skip to main content
13,449,333 members (46,184 online)
Rate this:
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
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()

continueEvent.Set() // is called

(Source[^], but please google yourself the next time)
Rate this: bad
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180318.3 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100