Introduction
This is just a code-snippet with which you can easily
display a netscape-like progressbar in your windows-statusbar. It has
2
different modes: (determined by value of the control)
- -1 = Animated Status, when remaining time is not calculateable
- 0-100 = Normal Status displaying
How does it work?
It adds its own panel to your statusbar at runtime and
handles all drawing in its own class.
The idea is based on Matthew Hazlett
Implementation
Using the code
Dim progress1 As ProgressStatus
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
progress1 = New ProgressStatus(StatusBar1)
With progress1
.Style = StatusBarPanelStyle.OwnerDraw
.MinWidth = 200
.BorderStyle = StatusBarPanelBorderStyle.Raised
End With
StatusBar1.Panels.Add(progress1)
Show()
End Sub
You can change the value and the animation speed like following:
progress1.progress = 53
progress1.progress = -1
progress1.Animspeed= 200
Points of Interest
No flickering, because the panel adds its own picturebox and draw then to it!
History
- 10/28/2004 first release
- 10/28/2004 (later) 2nd release with own panel-class (no flickering) &
cleaner code