开发者

ProgressBar for multiple WebBrowser instances

开发者 https://www.devze.com 2023-01-18 00:06 出处:网络
开发者_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)

开发者_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.

0

精彩评论

暂无评论...
验证码 换一张
取 消