Hi Friends....
I am stuck with BackGroundWorker. I learn Three basic steps to do work with Background worker.
Step 1 :- DoWork Event -- In this we do our work. i.e. Call Methods, Function, execute Querys' etc. and also enables background Properties like WorkerReportsProgress
, WorkerSupportsCancellation etc.
Step 2: ProgressChanged event : This is used to increment Progressbar value,and enable's access forms controls.
Step 3 : RunWorkerCompleted Event : It tells Work is completed or not .
But my problem is how to calculate max value for Progress Bar, how to increment Progress bar , because i have to call different methods some will retrieve values from Database, some will do work within the application. I changed style to Marque and set MarqueeAnimationSpeed but due to lot of Processing it hides the Progressbar.
If i put all methods in one Method then call that method in DoWork Event then it hides Progressbar. and shows it after doing all work.
If I call the part which take lot of time in DoWork event. by Calling method BackgrounfWorker.RunWorkerAsync() on btn_Click event then before going to DoWork Event it is executting lines bellow this method after executting all these then it is executting RunWorkAsync() method.
Please help me how to solve this Problem.