The progress is displayed when the webbrowser control in C # loads a webpage.
Code
Private Void Webbrowser1_progresschanged ( Object Sender, webbrowserprogresschangedeventargs E)
{
Progressbar1.visible = True ;
If (E. currentprogress > 0 ) && (E. maximumprogress > 0 ))
{
progressbar1.maximum = convert. toint32 (E. maximumprogress); /// set the total number of bytes of the document being loaded
progressbar1.step = convert. toint32 (E. currentprogress); // /get the number of bytes of the downloaded document
progressbar1.20.mstep ();
}
Else If(Webbrowser1.readystate=Webbrowserreadystate. Complete)//Hide the progress bar after loading
{
Progressbar1.value= 0;
Progressbar1.visible= False;
}
}
private void form1_load ( Object sender, eventargs e)
{< br> URI strurl = New uri ( " http://www.hainan.com " );
Webbrowser1.url=Strurl;
Webbrowser1.progresschanged+ = NewWebbrowserprogresschangedeventhandler (webbrowser1_progresschanged );
}
Display progress when the webbrowser control in VB. NET loads a webpage
Code
Private Sub Webbrowser1_progresschanged ( Byval Sender As System. object, Byval E As System. Windows. Forms. webbrowserprogresschangedeventargs) Handles Webbrowser1.progresschanged
Toolstripprogressbar1.visible = True
If (E. currentprogress > 0 ) and (E. maximumprogress > 0 ) then
toolstripprogressbar1.maximum = convert. toint32 (E. maximumprogress) ' set the total number of bytes of the document being loaded
toolstripprogressbar1.step = convert. toint32 (E. currentprogress) ' // get the number of bytes of the downloaded document
toolstripprogressbar1.20.mstep ()
ElseifWebbrowser1.readystate=Webbrowserreadystate. CompleteThen
Toolstripprogressbar1.value= 0
Toolstripprogressbar1.visible= False
End If
End sub
How does statusstrip Add a split column? ?
The "missing" function in vs2005 should be implemented,
You can change it manually.Code, Change one of its itme to this separator. For example:
Private system. Windows. Forms. toolstripstatuslabel toolseparator1;
Change:
Private system. Windows. Forms. toolstripseparator toolseparator1;
That is to say, this separator is still toolstripseparator.
This modification can be directly modified in the form1.designer. CS file of the Form. After the modification is completed, check that the modification is correct and switch to the setting interface to display the separator "|.