I have COM server application which controls another application CANoe. I want to show a progress bar on Form2 of COM application. The value of progress bar should be updated in the EventHandler. The eventHandler calls a method of form2 which will update the value of progress bar. The EventHandler is in main form.
private void mCANoeProgProgressChangedInternal(string sysvarName, object Value) // in main Form
{
if (mCANoeMeasurement != null && mCANoeMeasurement.Running)
{
ProgressBarForm.Prog_progress(Value);
}
}
And in Form 2 -
public void Prog_progress(object value)
{
progressBarProg.Value = (int)value;
}
it is showing an error
"An object reference required for the non-static field, method or property 'Form2.Prog_progress(object)'" at - ProgressBarForm.Prog_progress(Value); in main form.
Please provide your comments.