ProgressBar for multiple WebBrowser instances
开发者_StackOverflow社区How can I aggregate the CurrentProgress properties of multiple (dynamic amount) of WebBrowsers together so that a ProgressBar will look accurate?
if (currentProgressBar != null)
{
(currentProgressBar as ToolStripProgressBar).Maximum = (currentProgressBar as ToolStripProgressBar).Maximum;
(currentProgressBar as ToolStripProgressBar).Value = preValue + ((100 * (Int32)e.CurrentProgress) / (Int32)e.MaximumProgress);
if (e.CurrentProgress >= e.MaximumProgress)
{
preValue = (currentProgressBar as ToolStripProgressBar).Value;
}
}
This was how i was able to get the progress bar to display correctly for multiple web browser controls.
精彩评论