Thread1.WorkerReportsProgress = true;
Thread1.ProgressChanged += new ProgressChangedEventHandler(Function2HandleWhenProgressChanges); //When progress changes, define a function to handle it.
Thread1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Function2HandleWhenThreadIsFinished); //The function to run when the thread is finished
Thread1.DoWork += new DoWorkEventHandler(Thread1_DoWorkDo); //The function defining what the thread must do.
Now, I understand that ProgressChangedEventHandler is a delegate. A delegate, in turn, turns out to be a class.
1. "ProgressChangedEventHandler" belongs to which class ? I have not defined any in my code.
2. Is "ProgressChanged" an event ? If so, which class does this belong to ?
3. If I don't specify "new ProgressChangedEventHandler" still the code compiles ?. Something like below.
Thread1.WorkerReportsProgress = true;
Thread1.ProgressChanged += Function2HandleWhenProgressChanges; //When progress changes, define a function to handle it.
Thread1.RunWorkerCompleted += Function2HandleWhenThreadIsFinished; //The function to run when the thread is finished
Thread1.DoWork += Thread1_DoWorkDo; //The function defining what the thread must do.