How to use background worker with Progress Bar based on user state in C# //Intializing New Progress Bar var NCPB = new NewCustomisedProgressBar(); //Creating new Background Worker var bgworker = new BackgroundWorker(); //Setting Background Worker for reporting progress bgworker.WorkerReportsProgress = true; //Do The Main Work here in Background Thread bgworker.DoWork += delegate(object sender1, DoWorkEventArgs e1) { //Write the working code here //Remember GUI Triggering codes cant be written inside this //for that use Report Progress Funtion //Here I am triggering gui 5 times to make change in progress bar value after each task completion //First Time GUI Trigger,setting progress bar value to 0 (sender1 as BackgroundWorker).ReportProgress(0, 0); //Do The First Quarter Work Here //Second Time GUI Trigger,setting progress bar value to 25 (sender1 as BackgroundWorker).ReportProgress(0, 1); //Do The Second Quarter Work Here //Third Time GUI Trigger,setting progress b...
The perfect world is a mirage but can see it in some places. keep looking even mirages are a sign of hope.