Click here to Skip to main content
12,063,909 members (57,077 online)
Click here to Skip to main content
Add your own
alternative version


1.3K bookmarked

A Professional Ribbon You Will Use (Now with orb!)

, 12 Jun 2012 Ms-PL
Rate this:
Please Sign up or sign in to vote.
A serious project on an Office-like Ribbon control

New: Read the guide for embedding the ribbon on the non-client area.



Because of the lack of good free Ribbon controls on the web, I decided to write one myself. I've analyzed previous work on ribbon-controls, including those on CodeProject. Unfortunately, most existent controls are merely bad tries. Why? well, some lack nice rendering, some lack resizing features, some lack almost everything. Of course, well developed Ribbon controls are available at a price. This ribbon is free.

Why not WPF? Well mainly, because I needed the Ribbon to add it to my existing WinForms applications. In my opinion (the short version) this is not a "no" to WPF, is just a "not yet". Anyway, you can host a WinForms control in WPF (See this link).

Some of the Design Goals

Performance - This ribbon is contained on a Control window, and every element inside of it is managed as a bunch of bounds inside the control, just as the ToolStrip control does. Although this is difficult to manage from the ribbon's inside code, this is a way to keep it at the best performed ribbon. Believe me, download the demo, run it and resize the window. It performs beautifully.

Consistency with Office's Ribbon - I read once about Jakob Nielsen saying that most users prefer that the programs they use look just like Word, Excel or PowerPoint. This is quite obvious, because people use this software every day. Providing visual consistency with the Office's ribbon is very important because of that, people already know what to expect and that's a usability advantage. I've tried to see that every element in the ribbon looks and behaves exactly like it does in the Office's ribbon.

Ease of use for programmers - The naming of components is consistent with most WinForms naming system, even more with the ToolStrip elements. Property, event and method names for similar elements are named just like in the ToolStrip technology items.

Designer support - I will be adding more and more designer support so you can manage the ribbon 100% from the designer. Give it a try.

I will be providing updates and fixes for bugs, as I discover them or you kindly let me know about them.

Using the Ribbon

The ribbon is located in the System.Windows.Forms namespace, just as every other control, I think it's annoying to use controls named as MyCoolFirm.MyCoolNameSpace.MyCoolSubNameSpace and so on (Please do that only for business objects).

You can add a reference to the compiled DLL: System.Windows.Forms.Ribbon.dll or you can directly copy the source files to a folder on your project. The code is currently designed so you can just copy the source files, it doesn't need any extra resources.

Hands on: Quick Guide

The ribbon is composed mainly by three kind of elements, the tabs, the panels on the tabs (other developers call them groups) and the items inside the panels.




These elements are represented by RibbonTab, RibbonPanel and RibbonItem types. RibbonItem is an abstract class that provides basic functionality for any item hosted on a RibbonPanel or on a RibbonDropDown.

You can add tabs from the smart tag of the Ribbon, you can add panels to the tab by selecting the tab and calling the "AddPanel" verb on the bottom part of the property grid.

The elements on the ribbon are resized according to the available space for the ribbon. This is a key feature of the ribbon. It tries to bring all possible commands to the screen by resizing them, instead of hiding them on an overflow button like the old ToolStrip.

I treat this as three kinds of sizes: Large, Medium and Compact. An additional size is used for panels because panels can be collapsed, and then they will adopt the Overflow size.


Note: There's no way to directly affect the bounds of the elements on the ribbon, the size will always be determined the layout engine inside the ribbon. In fact, the layout depends on two factors: the available horizontal space on the ribbon and the size modes on the items.

If there's no available space on the ribbon for a panel, panel will be collapsed. If all panels are collapsed and space is not available yet, a scroll button will appear so user can scroll the panels horizontally.

Click to enlarge image


There's only one type of button: RibbonButton. It can be set to three styles:


RibbonButton adds the SmallImage property so you can set the image shown when button is in medium or compact mode. Although it's not restricted by functionality, it's highly recommended to use just 32 x 32 pixels for Image property and 16 x 16 for SmallImage property. Results are unexpected when sizes are different.

Note: Use the DropDownItems property to add items to the dropdown of the button.

The appearance of the buttons vary through size modes.


The buttons like those on the Font and Paragraph panels are RibbonButton buttons hosted inside a RibbonItemGroup group.


Items added to RibbonItemGroup will always be measured and treated in compact size mode.

Important: If a RibbonPanel will host RibbonItemGroup objects, you must set the RibbonPanel.FlowsTo property to Right. The layout on those items are treated differently because groups flow as rows.


Lists are represented by RibbonButtonList and provide two collections: Buttons and DropDownItems. This is because the list can be scrolled on the ribbon and can dropdown more items. The dropdown of list supports resizing by a grip on the south east corner.

If you want the buttons on the list to be shown on the dropdown, you will have to explicitly add another list with those buttons to the DropDownItems property.


Separators are represented by RibbonButtonSeparator and provides the well known separator functionality. When in a dropdown, separators can actually contain text. When they contain text, they will be rendered differently.



  • Getting Started With the Ribbon at 

Known Bugs

  • Multiple dropdowns not managed OK 
  • Drawing of collapsed panels when mouse down

Things To Do

  • Contextual tabs
  • ToolTips
  • (OK) TextBox, ComboBox
  • Checkbox and NumericUpDown RibbonItems
  • Orb and Quickaccess tools
  • Vista clientarea docking
  • Keyboard quick access through Alt key
  • Font and Color selectors
  • Right to left orientation
  • Ribbon minimization


  • 8 May 2008 - Original post
  • 29 May 2008 - Update
    • Enabled property now working
    • Added RibbonTextBox - A regular textbox with label and image
    • Added RibbonComboBox - (Inherited from RibbonTextBox) Offers a dropdown
    • Added RibbonColorChooser - A button that shows a color bar. See property Color
  • 23 Feb 2009 - Update
    • Orb and orb menu with designer capabilities
    • Quick Access Toolbar added
    • Some bugs fixed
  • 1 May 2009 - Update 
    • Orb and Quick access embedded on non-client area
    • Popup menus fixed!
    • Lots of Event handlers supported
    • Minor bugs fixed


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Jose Menendez Póo
Team Leader
Mexico Mexico
I'm in game programming now:

Jose Manuel Menéndez Poó

- I've been programming Windows and Web apps since 1997.
- My greatest concern nowadays is user interface usability.

Questions and stuff by twitter: @menendezpoo


You may also be interested in...

Comments and Discussions

AnswerRe: Impossible to use with up to date VS 2010 and Framework 4 Winform application Pin
adriancs3-Jan-13 3:28
memberadriancs3-Jan-13 3:28 
QuestionHow To remove or Hide all orb panel. Pin
shyam_s6-Nov-12 0:54
membershyam_s6-Nov-12 0:54 
QuestionToolTips Pin
William Sade5-Nov-12 18:21
memberWilliam Sade5-Nov-12 18:21 
AnswerRe: ToolTips Pin
adriancs3-Jan-13 3:48
memberadriancs3-Jan-13 3:48 
BugVisual Studio 2010 error when inserting items Pin
masterkale3-Nov-12 18:16
membermasterkale3-Nov-12 18:16 
GeneralRe: Visual Studio 2010 error when inserting items Pin
adriancs3-Jan-13 3:34
memberadriancs3-Jan-13 3:34 
QuestionThanks Pin
Vortex.piggy25-Oct-12 3:24
memberVortex.piggy25-Oct-12 3:24 
Questionbug Pin
30384018815-Oct-12 17:34
member30384018815-Oct-12 17:34 
Questionhow to use in framework 4? Pin
oware25-Sep-12 14:03
memberoware25-Sep-12 14:03 
AnswerRe: how to use in framework 4? Pin
silverkaosnew4-Oct-12 11:25
membersilverkaosnew4-Oct-12 11:25 
GeneralRe: how to use in framework 4? Pin
adriancs17-Oct-12 17:42
memberadriancs17-Oct-12 17:42 
QuestionLicense Pin
Filipe Scur5-Sep-12 14:19
memberFilipe Scur5-Sep-12 14:19 
AnswerRe: License Pin
toATwork1-Feb-13 5:38
membertoATwork1-Feb-13 5:38 
GeneralThanks Pin
SubonaInfotech@gmail.com21-Aug-12 18:21
memberSubonaInfotech@gmail.com21-Aug-12 18:21 
Thanks...Thank you very much......
Generalvery cool Pin
zhangqiao84040512-Aug-12 15:56
memberzhangqiao84040512-Aug-12 15:56 
QuestionSystem.ComponentModel.Design.ExceptionCollection Pin
salrouge10-Aug-12 3:02
membersalrouge10-Aug-12 3:02 
AnswerRe: System.ComponentModel.Design.ExceptionCollection Pin
adriancs8-Sep-12 4:32
memberadriancs8-Sep-12 4:32 
GeneralRe: System.ComponentModel.Design.ExceptionCollection Pin
Chris Townsend19-Nov-12 3:30
memberChris Townsend19-Nov-12 3:30 
GeneralRe: System.ComponentModel.Design.ExceptionCollection Pin
adriancs3-Jan-13 3:35
memberadriancs3-Jan-13 3:35 
QuestionDesigner Exception Pin
sudeep kushwaha29-Jul-12 22:42
membersudeep kushwaha29-Jul-12 22:42 
GeneralRe: Designer Exception Pin
Knightlie5-Aug-12 1:13
memberKnightlie5-Aug-12 1:13 
GeneralRe: Designer Exception Pin
adriancs3-Jan-13 3:38
memberadriancs3-Jan-13 3:38 
QuestionRibbon Control Pin
Devendra Godawatta28-Jul-12 19:45
memberDevendra Godawatta28-Jul-12 19:45 
AnswerRe: Ribbon Control Pin
adriancs3-Jan-13 3:50
memberadriancs3-Jan-13 3:50 
GeneralMy vote of 5 Pin
urektum25-Jul-12 22:13
memberurektum25-Jul-12 22:13 
QuestionException in design mode Pin
montyhammet16-Jul-12 11:16
membermontyhammet16-Jul-12 11:16 
AnswerRe: Exception in design mode Pin
sunco29-Jul-12 10:56
membersunco29-Jul-12 10:56 
GeneralRe: Exception in design mode Pin
adriancs3-Jan-13 3:37
memberadriancs3-Jan-13 3:37 
QuestionRibbonButton Size Pin
gonzaloleon12-Jul-12 12:55
membergonzaloleon12-Jul-12 12:55 
Questionhow to set the image of the left-top circle,and make it still has high-light style... Pin
Bason_Pei20-Jun-12 21:45
memberBason_Pei20-Jun-12 21:45 
QuestionNow what I would like to know is... Pin
Qwertie19-Jun-12 5:47
memberQwertie19-Jun-12 5:47 
AnswerRe: Now what I would like to know is... Pin
Jose Menendez Póo19-Jun-12 6:51
memberJose Menendez Póo19-Jun-12 6:51 
GeneralRe: Now what I would like to know is... Pin
Qwertie19-Jun-12 8:53
memberQwertie19-Jun-12 8:53 
QuestionBackground Image Pin
Bason_Pei17-Jun-12 22:29
memberBason_Pei17-Jun-12 22:29 
GeneralMy vote of 5 Pin
Forogar12-Jun-12 7:21
memberForogar12-Jun-12 7:21 
QuestionArabic Language Pin
Mohammed Abul-Haija11-Jun-12 17:51
memberMohammed Abul-Haija11-Jun-12 17:51 
QuestionException in designer file Pin
smohsin6-Jun-12 23:20
membersmohsin6-Jun-12 23:20 
AnswerRe: Exception in designer file Pin
adriancs3-Jan-13 3:40
memberadriancs3-Jan-13 3:40 
QuestionHow to hide Quickaccess and Orb Pin
cynatris4-May-12 23:30
membercynatris4-May-12 23:30 
BugGlobal Hook for Mouse Causes Freezing Pin
christo-bell2-May-12 6:59
memberchristo-bell2-May-12 6:59 
AnswerRe: Global Hook for Mouse Causes Freezing PinPopular
christo-bell3-May-12 1:02
memberchristo-bell3-May-12 1:02 
GeneralRe: Global Hook for Mouse Causes Freezing Pin
Chris Townsend13-May-14 3:12
memberChris Townsend13-May-14 3:12 
GeneralRe: Global Hook for Mouse Causes Freezing Pin
adriancs26-May-12 6:03
memberadriancs26-May-12 6:03 
QuestionCustomization of icons Pin
kurko_rock26-Apr-12 4:59
memberkurko_rock26-Apr-12 4:59 
Xaviersmork24-Apr-12 12:12
memberXaviersmork24-Apr-12 12:12 
QuestionInstalling Ribbon Hook's Error .net C# 4.0 Pin
marco.navarro28-Mar-12 18:43
membermarco.navarro28-Mar-12 18:43 
AnswerRe: Installing Ribbon Hook's Error .net C# 4.0 Pin
Richard Lumb29-Mar-12 0:40
memberRichard Lumb29-Mar-12 0:40 
AnswerRe: Installing Ribbon Hook's Error .net C# 4.0 Pin
adriancs26-May-12 20:18
memberadriancs26-May-12 20:18 
QuestionA couple of minor issues, if you are doing a new version. Pin
OriginalGriff12-Mar-12 5:40
mvpOriginalGriff12-Mar-12 5:40 
AnswerRe: A couple of minor issues, if you are doing a new version. Pin
Zac Greve26-Mar-12 21:57
memberZac Greve26-Mar-12 21:57 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160204.4 | Last Updated 12 Jun 2012
Article Copyright 2008 by Jose Menendez Póo
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid