Click here to Skip to main content
15,886,061 members
Articles / Programming Languages / Visual Basic

Adding an Office 2007 Style to your StatusStrip!

Rate me:
Please Sign up or sign in to vote.
1.75/5 (10 votes)
21 Nov 2006CPOL 39.5K   870   23   1
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):

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

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalc# version Pin
radioman.lt12-Sep-08 0:22
radioman.lt12-Sep-08 0:22 

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.