Click here to Skip to main content
15,894,907 members
Articles / Programming Languages / Visual Basic
Article

Animated Progress in Statusbar

Rate me:
Please Sign up or sign in to vote.
3.72/5 (8 votes)
27 Oct 2004 108.3K   551   25   19
Displays an animated progress in windows statusbar, NOT using the progressbar-control!

Image 1

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

VB.NET
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:

VB.NET
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


Written By
Engineer
Germany Germany
Thomas is interested in technical programming, networking and security technologies.

Currently he's studying at a german university

Comments and Discussions

 
GeneralSample app works great but doesn't when added to another project Pin
AChatelain17-Apr-07 6:43
AChatelain17-Apr-07 6:43 
GeneralRe: Sample app works great but doesn't when added to another project Pin
AChatelain17-Apr-07 6:57
AChatelain17-Apr-07 6:57 
QuestionVB.net Pin
beena shah11-Dec-06 19:33
beena shah11-Dec-06 19:33 
QuestionWorks first time and not again Pin
MMRR2-Aug-06 2:20
MMRR2-Aug-06 2:20 
GeneralAnimated status while loading database query [modified] Pin
abbasy17-Jul-06 0:22
abbasy17-Jul-06 0:22 
QuestionHow to Dispose of this? Pin
moon docker28-Jun-06 8:05
moon docker28-Jun-06 8:05 
QuestionStatus messages? Pin
cknipe30-Nov-05 1:34
cknipe30-Nov-05 1:34 
Hi,

First time in my life that I touch VB .NET, and really knows nothing about VB6 either. I'm doing rather well in my first application Big Grin | :-D

I finally after about 2 or so hours managed to get this working... It's definately allot more complicated than simply adding a couple of lines of code - but I guess that's to be expected.

Anyways,

What I was wondering... Now that I have my status BAR going ape in blue and looking all funky and stuff... To the left hand side of the bar, I have a 'status'. Is it possible to manipulate that?

I'd like to add some status messages here as far as my data downloads go that I get via HTTPS... i.e.

- Resolving Hostname
- Contacting Site
- Downloading (xx% Complete)

etc etc etc???

I've looked through the class, but I couldn't find anything (perhaps I looked for the wrong stuff), but if anyone can shed some light, I'd appreciate it allot.

Thanks,
Chris.

AnswerRe: Status messages? Pin
cknipe30-Nov-05 2:34
cknipe30-Nov-05 2:34 
GeneralNo refresh when programm has to work hard ... Pin
SMaurer3-Nov-04 23:13
SMaurer3-Nov-04 23:13 
GeneralRe: No refresh when programm has to work hard ... Pin
thomasdev4-Nov-04 2:47
thomasdev4-Nov-04 2:47 
GeneralRe: No refresh when programm has to work hard ... Pin
scott.simmons5-Nov-04 6:48
scott.simmons5-Nov-04 6:48 
GeneralRe: No refresh when programm has to work hard ... Pin
thomasdev6-Nov-04 4:20
thomasdev6-Nov-04 4:20 
GeneralRe: No refresh when programm has to work hard ... Pin
SMaurer6-Nov-04 5:41
SMaurer6-Nov-04 5:41 
GeneralRe: No refresh when programm has to work hard ... Pin
thomasdev6-Nov-04 12:08
thomasdev6-Nov-04 12:08 
GeneralRe: No refresh when programm has to work hard ... Pin
SMaurer6-Nov-04 23:31
SMaurer6-Nov-04 23:31 
GeneralRe: No refresh when programm has to work hard ... Pin
dscemama19-Jan-05 1:46
dscemama19-Jan-05 1:46 
GeneralRe: No refresh when programm has to work hard ... Pin
thomasdev20-Jan-05 11:41
thomasdev20-Jan-05 11:41 
GeneralFlickering Pin
Joel Ivory Johnson27-Oct-04 13:19
professionalJoel Ivory Johnson27-Oct-04 13:19 
GeneralRe: Flickering Pin
thomasdev27-Oct-04 22:12
thomasdev27-Oct-04 22:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.