View Code of the source file
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Linq;
Using System. Text;
Using System. Windows. Forms;
Namespace WindowsFormsApplication1
{
Public partial class WebBrowserProgressBar: Form
{
Public WebBrowserProgressBar ()
{
InitializeComponent ();
}
// Initial from
Private void WebBrowserProgressBar_Load (object sender, EventArgs e)
{
ProgressBar1.Visible = false;
}
// Load the progress bar
Private void webBrowser1_ProgressChanged (object sender, WebBrowserProgressChangedEventArgs e)
{
ProgressBar1.Visible = true;
If (e. CurrentProgress> 0) & (e. MaximumProgress> 0 ))
{
ProgressBar1.Maximum = Convert. ToInt32 (e. MaximumProgress );
ProgressBar1.Step = Convert. ToInt32 (e. CurrentProgress );
ProgressBar1.PerformStep ();
}
Else if (webBrowser1.ReadyState = WebBrowserReadyState. Complete)
{
ProgressBar1.Value = 0;
ProgressBar1.Visible = false;
}
}
// Jump
Private void btnGo_Click (object sender, EventArgs e)
{
If (! String. IsNullOrEmpty (textBox1.Text ))
{
WebBrowser1.Navigate (textBox1.Text );
}
}
}
From loafinweb