|
Establish a delegation:
_axWebBrowser.ProgressChange + = new
AxSHDocVw.DWebBrowserEvents2_ProgressChangeEventHandler (
this.mainBrowser_ProgressChange);
Reprocessing:
private void mainBrowser_ProgressChange (object sender, AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent e)
{// Handle progress bar events
AxSHDocVw.AxWebBrowser axWebBrowser1 = (AxSHDocVw.AxWebBrowser) sender;
HE_WebBrowserTag _HE_WebBrowserTag = (HE_WebBrowserTag) axWebBrowser1.Tag;
// If the current page does not match the current webbrowser, then discard it
if (_HE_WebBrowserTag._TabIndex! = this.MainTabCtrl.SelectedIndex) {return;}
processBar.Visible = true;
if ((e.progress> 0)&&(e.progressMax> 0))
{
processBar.Maximum = e.progressMax;
processBar.Step = e.progress;
processBar.PerformStep ();
}
else if (axWebBrowser1.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
{
processBar.Value = 0;
processBar.Visible = false;
}
} |
|