Hi,
I am currently working on a app that has multi web browsers on a tab control with progress bars on them. To save me duplicating code i wanted to create a method where i pass the progress bar name into a function. I have created the following below but i am getting this error.
'string' does not contain a definition for 'Maximum' and no extension method 'Maximum' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
private void PassPBName(string PBName)
{
// Event for the browser
AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent e;
/* The CurrentProgress variable from the raised event
* gives you the current number of bytes already downloaded
* while the MaximumProgress is the total number of bytes
* to be downloaded */
if (e.progress < e.progressMax)
{
// Check if the current progress in the progress bar
// is >= to the maximum if yes reset it with the min
if (PBName.Value >= PBName.Maximum)
PBName.Value = PBName.Minimum;
else
// Just increase the progress bar
PBName.PerformStep();
}
else
// When the document is fully downloaded
// reset the progress bar to the min (0)
PBName.Value = PBName.Minimum;
}
private void WBIntranet_ProgressChange(object sender, AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent e)
{
string progressBar = PBIntranet.Value.ToString();
PassPBName(progressBar);
}
Thanks