如何将多个(动态数量)WebBrowser的CurrentProgress属性聚合在一起,以便ProgressBar看起来准确?
答案 0 :(得分:0)
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;
}
}
这就是我能够让进度条正确显示多个Web浏览器控件的方式。