dear all
did anyone know how to implement backgroundworker tools using C# language.
Thank You
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nilanka DharmadasaPosted Nov 2, 2009, 11:57 PM
Backgroundworker component allows you to create a thread and execute a seperate process on that thread. During the process, backgroundworker can notify the progress to the main thread. And also user can abort this process at any time.
First go to design mode and drag a backgroundworker to the form. Then set the following properties of the backgroundworker.
First you must bind the following event of backgroundworker.
If you want to allow the user to abort the thread, set following property.
And also bind the following event of backgroundworker if you have something to do after the thread is finished.
Then if you want it to report the progress, set following property.
And also bind the following event of backgroundworker.
Hope this will help you. If it helps you please accept it.
Kirtan PatelPosted Nov 2, 2009, 10:28 PM
Just Drag One Back Ground Worker tool on Form
then In Do_Work Event Write the Code you want to Run Separately
and In Form_Load Event Just Execute RunWorkerAysnc() method to start Execution of Background Worker :)
private void Form1_Load(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
//Write the Code Here Which you want to Run in Seperate Thread :)
}
If my answer helps you then check "Do you like this answer" :)
Posted Nov 2, 2009, 9:58 PM
http://weblogs.asp.net/rosherove/articles/BackgroundWorker.aspx
with regards
prasad
jingePosted Nov 2, 2009, 8:51 PM
http://dotnetperls.com/backgroundworker