我目前正在開發一個應用程序,它在帶有進度條的選項卡控件上有多個web瀏覽器。爲了節省我重複的代碼,我想創建一個方法,將進度條名稱傳遞給一個函數。我在下面創建了以下內容,但是我收到了此錯誤。進度條,c#
「字符串」不包含「最高」和沒有擴展方法「最高」接受類型「字符串」的第一個參數的定義可以找到(是否缺少using指令或程序集引用?)
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);
}
感謝