Click here to Skip to main content
Click here to Skip to main content
Go to top

An easy way to add a Ribbon Panel Office 2007 style

, 18 Apr 2007
Rate this:
Please Sign up or sign in to vote.
GNU code of RibbonPanel, free software for personal and nonlucrative use, for rest please contact me
Screenshot - overview.jpg


A picture is worth a thousand words, well it was a really cute work at the end. Before explaining how to add it to your applications, I will show you the main features.

Features of RibbonStyle Namespace

  • RibbonButton: Transparency, Autosizable image, AutoForecolor, AutoInfoForm (see InfoForm, OnBackImage and ClickBackImage).
  • TabPanel: Transparency, BaseColor, BaseColorOn (Highlighted), Caption, Resizable.
  • TabStrip: Has inside:
    1. Tab: With Autowidth, BaseColor, HaloColor and Enable work.
    2. TabStripProffesionalRenderer: Controls the Tab Style (hard to work)
    3. TabStripPage: BaseColor, inherits my RibbonPanel.
    4. TabPageSwitcher: Controls the link between Tab and TabStripPage. Design functionality as the tabcontrol.
  • InfoForm (with Shadow): Depending on Title, Comment, and Image of Info.. Properties of RibbonButton resizes itself.

Using the controls

I hope that if you have understood the Features, the next will be easy for you.

  1. Make a new C# App.
  2. Add all the classes to your app.
  3. Now Rebuild the project.
  4. In the toolbox you will have many new controls:

    Screenshot - toolbox.jpg

  5. Now Add a Windows.Forms.Panel to the Form and dock to the top, adjust it like you want.
  6. Add the TabStrip inside the Panel.
  7. With the TabStripPageSwitcher you can add TabStrip. If you find it difficult to click on it, you can click in the properties window:
  8. Screenshot - tabpageswitcher.jpg

  9. With a TabStrip and some tabs and TabStrip pages, add TabPanels inside the TabStripPages (Check the TabPanel has BackColor.Transparent) . I recommend you to add a few of them to the form and copy and paste inside the tabStripPage (it is easy to dock them later). With the Tabpanels added, dock them to the left.
  10. Now add the RibbonButton inside the TabPanel, adjust its size and its images, copy and paste as you want and change the image. Don't worry about the text colors, they will be processed at runtime.
  11. If everything is ok and if you run it, you will see something like this (Azure Style):

    Screenshot - tabs.jpg

Creating your custom style

As you could see in the demo zip, it is possible to change the colors at runtime. Let's analyze the code. If you look at the Form1 code, there's a method SetStyle:

public void SetStyle(string Name)
    Color HaloColor = Color.White;
    switch (Name)
        case "Dark":
        this.BackColor = Color.FromArgb(88,77,69);
        HaloColor = Color.FromArgb(200,200,200);

You find out that you have to change only three colors! I hope you find it useful. The rest are sum or subs from the color components. So to avoid color errors, I recommend taking a look at my other article which has a color selector, only for the basecolor, HaloColor is the brightness over the tabs and the Backcolor is for the form.

Points of Interest

I have to say that I use the base of CustomTabstrip for the part of tabstrip. I was annoyed with the tabcontrol and after looking for something, the best was to inherit from a ToolStrip.

There's a lot of code in the project and I have written this with a lot of effort. If you need an explanation of any part, please ask me. It's .NET 2.0 code I put in a Windows 2000 machine and it works really well in XP and Vista too.

To design a better software, please vote the value of the code for you and if you vote, please tell me the pros and cons.


  • 1.0: The first version of the control library.


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


About the Author

Juan Pablo G.C.
Software Developer Expediteapps
Spain Spain
I'm Electronic Engineer, I did my end degree project at Astrophysical Institute and Tech Institute. I'm HP Procurve AIS and ASE ,Microsoft 3.5 MCTS
I live in Canary Islands ,developing customized solutions
I'm developing with WPF4, SL4 MVVM, MVC3 Razor and WP7 projects, more info at my websites. Improving with Android and IOS.

Take a look to my blog Juan Pablo G.C.

Comments and Discussions

Questionhow disable tooltip? Pinmembervinycc116-Oct-08 10:22 
AnswerRe: how disable tooltip? PinmemberJaime Stuardo8-Jan-10 15:24 
QuestionQAT?? Pinmemberkapil bhavsar24-Sep-08 20:33 
QuestionCan i use this in... PinmemberAmrykid19-Sep-08 14:40 
Questiondo it has VB.NET version? Pinmemberlimsoochen28-Aug-08 23:33 
AnswerRe: do it has VB.NET version? Pinmemberkaschimer19-Nov-08 5:55 
GeneralThe name 'TabStripControlLibrary' does not exist in the current context Pinmemberjacobjordan23-Aug-08 12:29 
QuestionShortCut key on ribbonButton? PinmemberTaiZhong30-Jul-08 5:09 
Generalcustom ribbon ready for cute app Pinmemberradioman.lt3-Jul-08 19:36 
GeneralRe: custom ribbon ready for cute app Pinmemberivanchain@hotmail.com26-Aug-08 15:46 
GeneralRe: custom ribbon ready for cute app Pinmemberradioman.lt27-Aug-08 5:34 
GeneralRe: custom ribbon ready for cute app Pinmemberivanchain@hotmail.com27-Aug-08 6:15 
GeneralRe: custom ribbon ready for cute app Pinmemberradioman.lt27-Aug-08 6:33 
GeneralRe: custom ribbon ready for cute app Pinmemberradioman.lt9-Sep-08 18:57 
GeneralTabStrip rendering problem, thank you! Pinmemberivanchain@hotmail.com26-Jun-08 4:56 
QuestionAbout the update of this control? Pinmemberivanchain@hotmail.com19-Jun-08 3:28 
GeneralThanks! Pinmembernapo@burgasnet.com18-Jun-08 0:57 
QuestionHow do i change background image of Ribbon button ? PinmemberEhsan Golkar11-Jun-08 3:34 
AnswerRe: This article is very very bad PinmemberEhsan Golkar24-Jun-08 20:13 
NewsCorrec color Problem PinmemberMember 46384115-Jun-08 6:40 
GeneralTabStrip, RibbonPanel into Toolbox PinmemberGeoff212-May-08 17:06 
GeneralGood control with some buggs PinmemberDanielWehrle13-Apr-08 21:38 
Generalright to left problem Pinmemberdarvish_boy1-Apr-08 23:52 
QuestionBlack tab problem PinmemberBadboy22TR19-Mar-08 14:14 
QuestionValue cannot be null [modified] Pinmember Programm3r 10-Mar-08 2:05 
GeneralFirst exception "System.Drawing.dll" occurs at System.ArgumentNullException Pinmemberyinix5-Mar-08 19:24 
GeneralFirst chance exception PinmemberStephen_Lahti13-Feb-08 8:14 
NewsRe: First chance exception Pinmemberyinix5-Mar-08 19:23 
GeneralRe: First chance exception Pinmemberayfo10-Mar-08 8:05 
GeneralOffice UI Guidelines Pinmemberderek_bartram29-Jan-08 13:36 
GeneralRe: Office UI Guidelines PinmemberDan Walmsley13-Feb-08 2:44 
AnswerRe: Office UI Guidelines PinmemberDerek Bartram16-Feb-08 2:11 
GeneralRe: Office UI Guidelines PinmemberDerek Bartram16-Feb-08 2:15 
QuestionHow to add child form? PinmemberMember 43219316-Jan-08 4:29 
GeneralI get "failed to load component" error PinmemberHaydeng23-Dec-07 14:53 
QuestionNo items within the toolbox [modified] Pinmember Programm3r 17-Dec-07 3:01 
Questioncan i have a version of this for visual studio 2003 PinmemberMember 468002613-Dec-07 17:30 
GeneralBUG: Info form image PinmemberDan Walmsley12-Dec-07 2:09 
GeneralRe: BUG: Info form image Pinmemberj10000_18617-Dec-07 11:08 
QuestionI would like to convert this source code to but it have error Pinmembersdev2-Nov-07 22:47 
GeneralRe: I would like to convert this source code to but it have error PinmemberSuperEric9-Feb-08 2:50 
GeneralUpdated Control Library PinmemberRobbiebell2222-Oct-07 9:04 
QuestionLicense? PinmemberPayton L Byrd16-Sep-07 14:50 
AnswerRe: License? PinmemberJuan Pablo G.C.17-Sep-07 23:01 
AnswerRe: License? PinmemberTheo du Preez4-Oct-07 23:23 
QuestionColour Corrections PinmemberEd.Poore15-Sep-07 11:55 
AnswerRe: Colour Corrections 23:32 
GeneralUrgent Report: Tab Problem Pinmemberivanchain@hotmail.com11-Sep-07 21:17 
QuestionHow to change the Azure renderer PinmemberOlivia8211-Sep-07 15:48 
GeneralI have just one thing to say. PinmemberAchintya Sharma4-Sep-07 16:04 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 18 Apr 2007
Article Copyright 2007 by Juan Pablo G.C.
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid