65.9K
CodeProject is changing. Read more.
Home

Adding an Office 2007 Style to your StatusStrip!

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.92/5 (6 votes)

Nov 21, 2006

CPOL
viewsIcon

39692

downloadIcon

872

An easy way to get the new look in your application...

Sample Image - statusstrip_demo.jpg

Introduction

I'm a young German student, so please forgive my bad English... This year, I installed the new Office Suite by Microsoft, and from the first minute using it, I really got fond of the nice GUI, especially the good-looking statusbar. Because I never saw a tutorial on how to do a similar background (I saw some tutorials to draw single items) I decided to take the chance and write one myself.

How it works

At first, I added the Double-Buffer functionality by using this code (posted for absolute beginners):

Public Sub New() 
    Me.DoubleBuffered = True 
    InitializeComponent() 
End Sub

To draw the background, you need the On_Paint event. The only thing to do is to draw the border on top and two LinearGradients (duration 1:2). If the SizingGrip should be painted (Me.SizingGrip = True), you should do it. To get the bounds to draw the SizingGrip, you can use this code:

Dim sgb As Rectangle = Me.SizeGripBounds

Using the Code

You can simply add the control to the toolbox and use it like a "regular" StatusStrip.