Click here to Skip to main content
15,890,438 members
Everything / BackgroundWorker

BackgroundWorker

BackgroundWorker

Great Reads

by SleepyCrat
A quick tutorial showing how to use .NET worker service to watch a directory for new files and read them
by Wonde Tadesse
How to utilize QueueBackgroundWorkItem(QBWI) for web applications that run a background process in IIS environment.
by Fiyaz Hasan
Integrating Cortana in Windows Apps (Foreground & Background interaction)
by Subramanyam Shankar
This tip describes how to use a background worker in WPF along with animation to provide better user experience.

Latest Articles

by Dev Leader
How Tasks, Threads, and BackgroundWorkers operate at high level
by SleepyCrat
A quick tutorial showing how to use .NET worker service to watch a directory for new files and read them
by Chris_Green
Get an event fired by Thread A to execute in the context of Thread B
by Wonde Tadesse
How to utilize QueueBackgroundWorkItem(QBWI) for web applications that run a background process in IIS environment.

All Articles

Sort by Score

BackgroundWorker 

15 Oct 2022 by SleepyCrat
A quick tutorial showing how to use .NET worker service to watch a directory for new files and read them
29 Feb 2012 by Dave Kreskowiak
This isn't described very well.But, you're saying that all three methods are executing at the same time?? Congratulations! You wrote your code to launch three different BackgroundWorkers or spawned your own threads to do it!All you would have to do is create ONE BackgroundWorker and...
23 Jul 2013 by Pheonyx
Yes, in the same way you would use it in a windows forms or WPF application.The background worker class is not application type dependent.The background worker on MSDN[^]The example writes to form controls, instead to write to the console.
3 May 2020 by Dave Kreskowiak
Quote: 'm building a small antivirus software in VB.NET. I hate to break it to you, but this is a waste of time. Antivirus is a hideously complex problem not even $Billion companies have successfully solved. Now, on to your code. Oh dear, where...
17 Jul 2012 by Sergey Alexandrovich Kryukov
Using named pipe directly is too lo-level for .NET. I mean, you could use them, but everything you are trying to do is already done for you with remoting. You could use classical remoting or self-hosted WCF. This way is quite good for your purpose but is also much more universal. The...
24 Jul 2013 by Sarin VT
Yes it is possible.A sample console program with backgroundworkwr.class Program{ private static BackgroundWorker worker = new BackgroundWorker(); private event EventHandler BackgroundWorkFinished; static void Main(string[] args) { worker.DoWork +=...
7 Jan 2014 by Rahul VB
Hello Mam, When ever we start a form based application, the application starts on a single UI thread. Now if i perform some operation using some of its controls. Suppose, on button click, perform some calculation. If the calculation is small its okay, but as the work to be done grows,...
11 Jan 2014 by Alan N
Hi Jayanta,I was reading the discussion you were having with OriginalGriff and I wonder if the real problem is the poor performance of Microsoft's TableLayoutPanel. If you are having issues with redraw then enabling double buffering on the control will speed it up. I have found that on .NET...
7 May 2019 by Graeme_Grant
I've written an article on SQLite that shows how to work with both synchronous and asynchronous methods that should answer all of your questions: Working with SQLite in C# & VB[^]
29 Feb 2012 by Sergey Alexandrovich Kryukov
In addition to Solution 1 and Solution 3.Of course, you can always change the priority of a thread:http://msdn.microsoft.com/en-us/library/system.threading.thread.priority.aspx[^].You can also change the priority of a process. The thing is: in almost all cases, you should not do it....
8 Jul 2012 by Sander Rossel
The BackgroundWorker.RunWorkerCompleted[^] runs on the main thread. If you're opening up your Form[^] on the main thread and the Load[^] or Shown[^] Event[^] takes up some time to complete then your application is waiting for the Load or Shown Event to do its work.Opening your Form on a worker...
10 Aug 2012 by Manfred Rudolf Bihy
In a sample on MSDN you can learn how a BackgroundWorker operates: How to: Run an Operation in the Background[^]. The DoWork and RunWorkerCompleted event handlers you'll hook up to the backgroundworker will do the brunt of the work. You'll have to make sure though that the processing and/or save...
12 Sep 2012 by Sushil Mate
Have you set this properties?backgroundWorker1.WorkerReportsProgress = true;backgroundWorker1.WorkerSupportsCancellation = true;
6 Nov 2012 by D-Kishore
Dear Experts.In my c# windows application, i have two buttons(export and cancel).In export button i am starting one background worker-it will export database table data to the .csv file.When ever the user clicks cancel button, I am displaying the message box("cancel the operation, do...
4 Dec 2012 by Dominic Abraham
HiIf you just want to blink the label, i think the below code is enough:private void btnStartTimer_Click(object sender, EventArgs e){ timer1.Enabled = true; timer1.Interval = 500; timer1.Start();}private void btnStopTimer_Click(object sender, EventArgs e){ ...
28 Dec 2012 by _Noctis_
Hi guys, I'm trying to wrap my mind around this asynchronous and background worker stuff ...As a playground, i have a WPF application that searches for prime numbers.Basics are easy. Create bgw (my short for BackGroundWorker), create DoWork, RunWorkerCompleted, ProgressChanged delegates....
28 Dec 2012 by Sergey Alexandrovich Kryukov
Perhaps, first thing you need to understand is that the methods are completely agnostic to the thread they are executed in. Any thread can call any methods, and any method can be called in any thread. To really understand it, you should understand how all this call-and-return model really words....
7 Jan 2013 by leprechauny
for (int currPort = firstInterval; firstInterval
7 Jan 2013 by fjdiewornncalwe
You just need to create threadsafe calls:How to: Make Thread-Safe Calls to Windows Forms Controls[^]
23 Jul 2013 by Makarand Borawake
Is it possible to use backgroundWorker in C# console application. If yes then how??
25 Jul 2013 by Alan N
The BackgroundWorker class can make threading simple to use because it marshals the ProgressChanged and RunWorkerCompleted events to the UI thread. BUT waiting to catch you out is the poorly documented requirement that the RunWorkerAsync method must be called from the UI thread.If...
5 Nov 2013 by Ziee-M
lets say your thread method have a loop in wicth you are coding the data transfer from DB to File, you have to add a condtion in there to put your thread on hold.here is an exemple!//class level declaration!public AutoResetEvent autoRest = new AutoResetEvent(false);bool...
6 Jan 2014 by JayantaChatterjee
Hi all,I create a form which have some function perform on the form_load, at the meantime I want to show a form(like "please wait").I used Background Worker. My code is :-private void QuestionForm_Load(object sender, EventArgs e) { WP = new WorkerProgress();//here...
24 Jun 2014 by Sergey Alexandrovich Kryukov
This is not a valid URL. Valid URL should start with the URI Scheme "http://" or perhaps "https://". You domain should be known to the DNS, prescribed in the DNS data.Please see:http://en.wikipedia.org/wiki/URI_scheme[^],http://en.wikipedia.org/wiki/DNS[^].—SA
12 Oct 2014 by Sergey Alexandrovich Kryukov
First of all, correct question would ask about threads, not BackgroundWorker, which is just one of the ways to create a separate thread.This is not the purpose of System.Threading.EventWaitHandle (manual or auto-reset are just to options or reset; this class is derived into two classes,...
14 Oct 2014 by KarstenK
Background tasks are not wanted by Apple design. You should keep that really in mind.A good tutorial is from the Ray Wenderlich.Another solution can be Notifications.
13 Nov 2014 by Michael Ulmann
Have a look at the example on MSDN:[^]You have to cast your sender argument to type BackgroundWorker:BackgroundWorker worker = sender as BackgroundWorker;Then you can pass that worker into mymethod as an argument.public void mymetod(BackgroundWorker worker){ ...
13 Nov 2014 by BillWoodruff
There's a good tutorial here on CodeProject: [^].You will want to locate the 'while loop ... or whatever else causes multiple iterations of exceuting code ... shown in your code in the BackGroundWorker's 'DoWork EventHandler.
23 Mar 2015 by F-ES Sitecore
You can only send html to the client as part of a request. Your request just kicks off the thread, the thread itself is not running as part of an http request so can't write to the client, that includes downloading the file or showing a message or updating the html in any way. Basically you...
30 Sep 2015 by DoomMaker79
Hi,I have a method that populates a treeview. I call this method from a listview with MouseDoubleClick. This method does all the job: reads the SQL table, generates 3 List (parent, child, grandchild) and some if... and foreach... loops builds the treeview from these lists' elements. Works...
10 Oct 2016 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Your answer here - c# - Progressbar for loading data to DataGridView using DataTable - Stack Overflow[^].
11 Apr 2018 by OriginalGriff
A background worker is good - but it's name suggests something that isn't true: it doesn't run at a lower priority than normal threads, it is a normal thread that will be automatically closed automatically when all foreground threads have exited (so your app doesn't have to worry about cleaning...
4 Feb 2022 by OriginalGriff
Your "small sample" of code will not work. You can't add an infinite amount of data to a Text box, Rich or not: each time you try, you create a new string which is longer than the last, and cause a Paint event to be queued on the TextBox - which...
16 Jan 2023 by OriginalGriff
The simplest solution is to create a new background worker each time, and pass it the data it needs to send to SQL. Me? I'd pass it a string collection and let it deal with converting it to bytes and then transfering that to the DB. If each file...
9 Jan 2012 by skilllab
Good day everyone.There is a class that performs some work:public class MyNew { private bool Initialize() { this.InitializeProgressDialog(); return true; } private void...
9 Jan 2012 by BobJanova
I don't really understand the question. (I'm guessing English isn't your first language? I find it hard to read what you've typed.) But the problem here appears to be that you are mixing the calculation code and display code. The code that performs the calculation (which appears to be MyNew, I...
29 Feb 2012 by akul123
Thank you your response.Now I am trying to make the situation clear. private void bgwLoading_DoWork(object sender, DoWorkEventArgs e) { ArrayList a = (ArrayList)e.Argument; string[] fileNames = (string[])a[0]; bool isLoad =...
30 Mar 2012 by V.
You should be able to use the Dispatcher[^] property on that. Use the Disptachers CheckAccess() method the check how to access the control. (note CheckAccess does not appear in intellisense.)Here's a sample where the backgroundworker thread calls the SetMsg function to update the label...
30 Mar 2012 by fjdiewornncalwe
This article explains this topic very well. You should use the search functionality on CP to see if the answers to your questions already exist. Cheers.Accessing Windows Forms Controls across Threads[^]
5 Apr 2012 by bobishkindaguy
SOLVED - PLEASE SEE COMMENTS BELOW IF YOU ARE INTERESTED IN HOW THIS WORKED OUT, SINCE IT IS A 2-PART SOLUTION, BOTH OF WHICH ARE POTENTIALLY USEFUL TO OTHERS.Often, users will go to my program's "import data" window to initiate an import of data from a file or spreadsheet to our database....
12 Apr 2012 by Prafulla Sahu
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..
12 Apr 2012 by Henning Dieterichs
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 nowcontinueEvent.Reset(); //If this is called within an...
7 Jul 2012 by JoThousand
Hi,My program has 'applets', so to speak, so I use a string called AppQueue to tell the BackgroundWorker what to do.I'm using the BackgroundWorker control to open new forms in the background (keeping the main application form responsive) as some of them take a long time to load.I...
12 Sep 2012 by MAU787
hi alli have windows dot net application in which i m capturing image and displaying it in picturebox.but after capturing i am doing some processing on that image it takes some timenow i want to show progress bar at the bottom of my form until the image is displayed.i have used...
6 Nov 2012 by Sergey Alexandrovich Kryukov
Not background worker, a thread, any thread. Well, Pause and Resume were deprecated as unsafe. Basically, a thread can get a thread synchronization object and get paused before releasing it. It can easily jam the whole process or some threads of it until the process is terminated by some...
29 Jul 2013 by akjha16
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using...
6 Nov 2012 by akjha16
// AMIT KUMAR JHA xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfx="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" Title="Window1" Height="300" Width="500"...
27 Nov 2012 by Dave Kreskowiak
You cannot interact with UI items from a background thread. ALL access to ANY UI items must be done on the UI thread (the thread your app started on).All of the code after and including the SalesReport sreport..." line MUST be run on the UI thread, not in the BackgroundWorker.Judging by...
4 Dec 2012 by Dustin Prevatt
I am attempting to use backgroundworker to call a timer that flashes a label in my windows form UI, but I am not having any luck. Here is my code. private void button1_Click(object sender, EventArgs e) { backgroundWorker1.RunWorkerAsync(); //do alot of other...
4 Dec 2012 by Dominic Abraham
Hi Timer and Backgroundworker are running in two different threads. So you cannot simply access the timer control from Backgroundworker. Can you please try the below code:private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { ...
6 Dec 2012 by Dustin Prevatt
I have an app that is doing all of it's work in either the form_load or the backgroundworker. What I would like to do is make the application close itself once all of the work done by the backgroundworker is completed. Here is my code: private void Form1_Load(object sender, System.EventArgs...
7 Jan 2013 by Tharaka MTR
Yes, you are write.this cross domain error will occur when the following lines executeresultTxt.AppendText("Port " + currPort + " open\r\n");resultTxt.AppendText("Port " + currPort + " closed\r\n");That because, you are going to access the Main Thread control within the background...
28 Jan 2013 by Dave Kreskowiak
You can NOT do ANYTHING with any user interface objects from a thread. Only the UI (startup) thread should be used to do any user interface work. If you're trying to put up a dialog of some kind, or modify a control on a form, or change a property on a control, or even call a method on a...
28 Jan 2013 by TangieTown
Changed:private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e){ MethodInvoker proginvoke = delegate { progressBar1.Value = e.ProgressPercentage; }; progressBar1.BeginInvoke(proginvoke);}to: private void...
12 Feb 2013 by jkhann
Hi guys,I have a server-client system going on with client commands controlling the server form. The commands are connect, disconnect, send and receive.When client wants to send data to/receive data from server (command == send/receive), there will be a progress bar (marquee style)...
12 Feb 2013 by srikanth pachava
instead of progress bar use can use ajax loaders (.gif) files this is easier.
13 Feb 2013 by Jegan Thiyagesan
Hi, Have you tried this.//disconnectpublic void SetStatusDelegate (bool state, string label);public void disconnectFlag(){ new SetStatusDelegate(SetStatus).Invoke(false, "disconnect");}//processingpublic void processingFlag(){ new...
13 Feb 2013 by Jegan Thiyagesan
HiThat means you are blocking the main thread. Try this:public bool startServer(){ if (_serverThread != null) { return false; } Task taskA = Task.Factory.StartNew(() => { Server _Server = null; _Server = new Server(); ...
14 Feb 2013 by Jegan Thiyagesan
HiHave a look at this article, http://jeremybytes.blogspot.ca/2012/05/backgroundworker-component-im-not-dead.html[^]This explains when to use background worker and when to use TPL. This article also has a link to solution similar to what you are looking...
12 Mar 2013 by victor manuel de anda
Hello im making a mdi winforms application c# and i need something that every x minutes, my program makes a search in my database and if found a new record i need that a label text updates in the mdiparent. I know how to do this with a timer in the mdi parent, but i want to make it better...
12 Mar 2013 by OriginalGriff
It's not trivial, but probably the best way would be to use the SqlDependancy class[^] - that is what it is designed for. When the database changes, it notifies you, rather than you querying the DB all the time.
27 Mar 2013 by Abhinav S
You can't directly do this. You first need to set WorkerSupportsCancellation to true.Try http://elegantcode.com/2009/07/03/wpf-multithreading-using-the-backgroundworker-and-reporting-the-progress-to-the-ui/[^].
28 Mar 2013 by dmunisubbu
In my WPF application,When user click on the export button,I am exporting large data to the .CSV file.for this process i am using backgroundworker. Here its exporting fine and its take long time.At the same time i need to update Progress Bar.For this reason,i need a solution...
28 Mar 2013 by S. M. Ahasan Habib
I think many ways you can do that.1.You can use 2 Backgroundworker instance for execute 2 different procedure.2. You can use 1 Backgroundworker which will update your progressbar another you can create a thread and run that thread as background thread. That will execute your another...
12 Jun 2013 by vijay kakani
Hi Everyone,I'm new to Open CV and present working on my project which needs background separation done with OpenCV.Two days back I configured Open CV with Visual Studio C++ 2010 and worked on small tutorials from this blog http://opencv-srf.blogspot.ie/By I am not sure about how to...
19 Jul 2013 by OriginalGriff
You can only access UI controls from the UI thread - the main thread. If you try from any other thread, you will get the exception you have seen.There are two ways to get round it:1) Use Control.Invoke to move the action back to the UI thread.2) Do the control update in the...
19 Jul 2013 by Sergey Alexandrovich Kryukov
Certain cross-threads calls are not allowed, by a number of reasons. You can easily delegate some methods to UI thread. This way, you can create an object in UI thread, and call all its methods in UI thread, but the calls are triggered in some other thread. This is the case when you call...
24 Jul 2013 by Makarand Borawake
How to call backgroundworker from backgroundworker in c#? Also want to know about how to handle multiple thread in c#?
25 Jul 2013 by lukeer
Nothing special here. You call a BackgroundWorker from another BackgroundWorker the exact same way you would call it from the main thread: via the RunWorkerAsync()[^] method.Or use the RunWorkerAsync(object)[^] overload.The BackgroundWorker then fires its DoWork[^] event. Subscribe a...
25 Jul 2013 by OriginalGriff
A BackgroundWorker thread is just another thread: so anything you can do in a "normal" thread you can do in a BackgroundWorker (except access UI components, of course) - and that includes starting new threads.The only complexity you might find is keeping track of which thread code is in: but...
25 Jul 2013 by Winston Madiano
See this linkhttp://winstonmadiano.wordpress.com/2013/06/04/vb-net-multi-threading-using-background-worker-and-delegate/[^]C# Codeusing Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using...
18 Sep 2013 by CPallini
Quote:Is it possible to do this using C# winform?Yes, of course. However it really depends on your exact requirements.Quote:How if I use threading / background worker?You probably have to.Quote:Will it run smoothly?Again, yes, but it really depends on the requirements (e.g. graphics...
23 Sep 2013 by Sarin VT
1) Is it Possible to use multiple backgroundworkers in a single form?2) How is it different from Multithreading?3) How is it different from assigning multiple DoWorks to a single background worker?
23 Sep 2013 by Valery Possoz
Hello.I recommend you read this article:Background Thread? Let me count the ways....[^]You will find a lot of information about threading.Valery.
1 Oct 2013 by ncaewar
Merhaba,Bir tane backgroundworker nesnesi kullanarak form üzerinde bulunan bir treeview' e database' den veri yüklüyorum. DoWork' un yapısı,delegate void delege(object sender, System.ComponentModel.DoWorkEventArgs e);private void backgroundWorker1_DoWork(object sender,...
2 Oct 2013 by OriginalGriff
I know that isn't your actual code (because it won't compile - you mispelled "delegate")And I'm not sure you want to do that anyway, because the whole idea of Invoke is to move code back onto the UI thread so you can access controls - and that means that your background worker just shifts the...
2 Oct 2013 by ncaewar
Form is not responding....using System;using System;using System.Windows.Forms;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); for (int i = 0; i
18 Oct 2013 by OriginalGriff
Doing the Threading stuff is pretty easy - a Background worker will handle that: BackgroundWorker work = new BackgroundWorker(); work.DoWork += new DoWorkEventHandler(work_DoWork); work.ProgressChanged += new...
10 Jan 2014 by Rahul VB
Hello Mam, look at the code below: class Class1 { static TableLayoutPanel tlp; public Class1(TableLayoutPanel TLP) { tlp = TLP; } public void doWork(object sender,DoWorkEventArgs e) { ////perform...
13 Jul 2014 by Tino Fourie
Not sure if the OP is still in need of a solution judging from what replies he got - nothing of value - and the date this question was posted.I have a similar situation while sending an email with attachments. I use a single Timer control to manage the "firing" order of my Backgroundworker...
16 Jul 2014 by Uknownymous
I already banging my head with this problem, I use backgroundWorker to check if database is OPEN and here's my code for that:Public Class Form1 Delegate Sub SetLabelText_Delegate(ByVal [Label] As Label, ByVal [text] As String) Dim sqlconnection As New SqlConnection("Data...
16 Jul 2014 by Pheonyx
Study your code and think logically about what you are trying to do.You do no form of polling to the database with the connection, there is nothing that truely does what you are asking for except one when the program loads. Also, I'm not sure if the "sqlconnection.State" property will get...
16 Jul 2014 by OriginalGriff
Well...yes. You are missing something.Look at your code and assume it works the first time.What happens the second time it is executed?Simple: the connection is open, so this test fails: If sqlconnection.State = ConnectionState.Closed ThenSo you don't do anything in your...
16 Jul 2014 by nilesh sawardekar
Public Class Form1 Dim lblInfo As string Dim sqlconnection As New SqlConnection("Data Source=" & My.Settings.Server & ";Initial Catalog=" & My.Settings.Database & ";Integrated Security=false;user id=" & My.Settings.Username & ";password=" & My.Settings.Password & ";Connection...
24 Jul 2014 by Job MK
Replace it with s_KeyboardHookHandle = SetWindowsHookEx( WH_KEYBOARD_LL, s_KeyboardDelegate, IntPtr.Zero, 0);or try this A Simple C# Global Low Level Keyboard Hook[^]
15 Aug 2014 by 4L4K1
when I want to show a dataGridView with backgroundWorker I call showDGV("mydataGridViewname") in bw_dowork function . delegate void Dstr(string s); public void showDGV(string s) { if (Controls[s].InvokeRequired) { Dstr h = new...
27 Sep 2014 by dovla091
sorry for bugging you guys with such a small problem, but I cannot find a solution. I have created one class for getting attachments from exchange server and Form for adding server configuration and textbox which I attend to use for the log output. I have added backgroundWorker to create...
10 Oct 2014 by Sergey Alexandrovich Kryukov
The apparent solution could be simple. In your FIFO, store not just threads but give each thread its separate instance of System.Threading.EventWaitHandle, System.Threading.Monitor, instead of a thread instance, keep in your FIFO the record composing this instance with the EventWaitHandle or...
15 Oct 2014 by hansoctantan
Hello Everyone,Can you help me with this one. Backgroundworker should make the Form responsive but my code is not doing that. Is there something wrong with the below code. Private Delegate Sub EncyptFilesDelegate()Private Sub EncyptFiles() If Me.InvokeRequired Then ...
15 Oct 2014 by Richard Deeming
The reason should be fairly obvious:Private Sub EncyptFiles() If Me.InvokeRequired Then Me.Invoke(New EncyptFilesDelegate(AddressOf EncyptFiles), New Object() {}) Else 'MORE CODE (Declaration, Create Folder, etc) For Each Filename As String In...
13 Nov 2014 by Member 11068876
Hi, there is any way to do something like this?public void mybw_DoWork(object sender, DoWorkEventArgs e){...while(...){ ... mymetod(); ....}....}public void mymetod() {......//Here i want to call mybw.ReportProgress, how can i do...
23 Mar 2015 by PandIyan T
i wants to use the BackgroundWorker in asp.net with ajax to get the data from the data base and export it into excel. when click the start button backgound worker will start load the data from database and write into excel when process complete that excel will download. these process show to use...
30 Mar 2015 by oronsultan
i need to extract data from ms access table. the table. for example, contained 93 fields and the recordCount is 4000. now, i have 2 progress bar. one for the record count and one for the field. i need to update them while extracting the data but it wont work with backgroundworker. i'm having...
31 Mar 2015 by Jaroslav Mitrovic
Hi.Try to change the Order of the Reading and the Application.DoEvents()First theApplication.DoEvents()then the Hard work ;)followed by the Progressbar Refresh.While reader.Read() dg.Rows.Add() pb.Value += 1 pb.Refresh() frmMain.lblStatusMain.Text =...
7 May 2015 by Abhishek Kumar (here to help!!)
HI, I've following scenario:* I'm working on WPF application, with Nav-Frames and XAML Pages concept for navigation between pages.* On Unload of a page I've created a backgroundworker and started it asynchronously // Create a background threadBackgroundWorker m_AsyncWorker =...
7 May 2015 by Florian Braun
to make Backgroundworker report its progress you have to call m_AsnycWorker1.ReportProgress(int percentProgress); from withing bw_Async_DoWork.To Cancel your Backgropundworker call m_AsnycWorker1.CancelAsync() from outside bw_Async_DoWork.
25 May 2015 by chintarajaramesh
Hi i implemented Windows Phone 8.1 Silver Light application Background scheduler using below link.The scheduler is working fine but when i call Async method it is not pining with server.Here this async method without background is working fine. But when i call this async method in...
25 Jun 2015 by JayantaChatterjee
I am created an application where create more than 700 Labels in flowLayoutPanel. the creation process done in DoWork event of BackgroundWorker Class, but when the process started then the UI freeze.I read and search all the tutorial about BackgroundWorker class and I follow the instruction,...
26 Jun 2015 by JayantaChatterjee
Here is my final code:private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { for (int i = 1; i