Sunday, January 10, 2010

Flexible Progress Control

A while ago I was looking for an easy way to design decent preloaders- hopefully to allow people to create something along the lines of some of these Flash preloaders showcased in Smashing Magazine.

The approach that I put together is a custom control (StoryboardedProgressControl) which is a subclass of ProgressBar, but uses an Storyboard to represent the loading progress. To use it you just create an animation of what the loading progress should look like and it just seeks to the appropriate time. This way you can represent progress in anything which can be animated- colors, paths, etc.

StoryboardedProgressControl.cs

image

Sample Application, sample source. (thanks to Celso for the Bottle loader graphics!)