I have a command line tool written in c# (that i have the source of) that I am making a gui for in visual studio 2010. In the gui I want to update the progress bar to reflect the progress of the tools operations. How would I signal from inside the tool that progress has been made and to update the progress bar?
Some simplified example code of what im doing.
private void doThings_Click(object sender, EventArgs e)
{
myToolInstance.doWorkThatNeedsToReportProgress();
}
The work that is being done by the tool is a series of function calls, normally around 30. I want to update the progress bar each time one of those finishes.
Create a public property or a public method in the form containing the progress bar
Now you can update the progress bar with
Another approach is to have a
ProgressChangedevent somewhere and let the form subscribe to this event.In the form you would have something like this