Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Animated Progress in Statusbar

0.00/5 (No votes)
27 Oct 2004 1  
Displays an animated progress in windows statusbar, NOT using the progressbar-control!

Animation created with Camtasia Studio 2 Evaluation Version

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  'percent= possible values: 0-100 !

        progress1.progress = -1  'animates the bar

        progress1.Animspeed= 200 'ms!

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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here