Click here to Skip to main content
15,881,866 members
Articles / Desktop Programming / Windows Forms

Easily Add a Ribbon into a WinForms Application

7 Aug 2019Ms-PL2 min read 2.3M   38.1K   618   655
Easily add a ribbon to a WinForms application

Style 2007

Image 1

Style 2010

Image 2

Style 2013

Image 3

Background

The ribbon that is going to be used in this article is an open source project created by Jose Menendez Poo. However, the original author of the ribbon has stopped support of it. A group of fans of this ribbon re-host and continue to develop/enhance and support the ribbon.

The original ribbon creator has posted an article explaining what this ribbon is all about at [A Professional Ribbon You Will Use (Now with orb!)]. However, that article doesn't describe how to use it in your project. Therefore, this article will show how to use it.

How to Use this Ribbon Control

The ribbon class library can be added via Nuget. Right click your project and go to "Manage Nuget Packages..."

Image 4

Search "RibbonWinForms" and install the nuget package.

Image 5

Drag the ribbon control into the form.

Image 6

Click "Add Tab".

Image 7

Click "Add Panel".

Image 8

Showing the commands of the "Panel":

Image 9

Click the command and add the controls you want.

Image 10

Changing the icon and button text label.

Image 11

Adding the "Click" event.

Image 12

Type the commands that you wish to do in the event block.

Image 13

Now, try run the application.

Image 14

Example of using RibbonForm style.

Image 15

Replace the inheritance of "Form":

Image 16

to "RibbonForm".

Image 17

Note

Some behaviour of "RibbonForm" might not be working properly in some unknown circumstances. We recommended that you to perform the test in your environment before delivering your application into production.

Alternative Ribbon Control

Windows Ribbon Framework
https://docs.microsoft.com/en-us/windows/win32/windowsribbon/-uiplat-windowsribbon-entry 
Support Windows 7 onwards

Krypton WinForms components for .NET
https://github.com/ComponentFactory/Krypton

RibbonLib
https://github.com/ennerperez/RibbonLib 
https://www.nuget.org/packages/RibbonLib

Windows Ribbon for WinForms
https://github.com/ennerperez/RibbonLib 
http://blogs.microsoft.co.il/arik/2010/11/08/windows-ribbon-for-winforms-v26-released/ 
http://www.codeproject.com/Articles/55599/Windows-Ribbon-for-WinForms-Part-0-Table-of-Conten

Ribbon by Juan Pablo G.C.
http://www.codeproject.com/Articles/18449/An-easy-way-to-add-a-Ribbon-Panel-Office-2007-styl 
http://www.codeproject.com/Articles/19044/The-new-RibbonForm-RibbonRoundButton-and-FastMenu

History

  • 8th August, 2019: Publish Nuget Package, several bug fixes
  • 12th April, 2012: Initial version

License

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


Written By
Product Manager
United States United States
- I've been programming Windows and Web apps since 1997.
- My greatest concern nowadays is product, user interface, and usability.
- TypeScript / React expert

@geeksplainer

Written By
Software Developer
Other Other
Programming is an art.

Written By
Software Developer (Senior)
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Written By
Software Developer (Senior)
United States United States
Lead Software Engineer on a paperless office / workflow system. I specialize in building custom user controls and components that are using in my everyday software. I've also worked with Neural Networks for character recognition on documents in my paperless office software.

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

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

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

Comments and Discussions

 
GeneralMy vote of 5 Pin
rageebnayeem13-Jan-13 11:14
rageebnayeem13-Jan-13 11:14 
GeneralMy vote of 4 Pin
Md. Tariq-ul Islam13-Jan-13 0:39
Md. Tariq-ul Islam13-Jan-13 0:39 
GeneralThank you Pin
Ebrahim Alareqi13-Jan-13 0:26
Ebrahim Alareqi13-Jan-13 0:26 
GeneralMy vote of 5 Pin
iman mohadesi11-Jan-13 19:43
iman mohadesi11-Jan-13 19:43 
GeneralMy vote of 5 Pin
Jason Fang_10-Jan-13 19:35
Jason Fang_10-Jan-13 19:35 
Questiongetting error in ribbon control Pin
Code-Hunt7-Jan-13 19:12
Code-Hunt7-Jan-13 19:12 
AnswerRe: getting error in ribbon control Pin
adriancs9-Jan-13 21:16
mvaadriancs9-Jan-13 21:16 
AnswerResolution of "bugs" Pin
Shiraz S K30-Dec-12 18:53
Shiraz S K30-Dec-12 18:53 
Hi,

Just as a guide for those of us out there who are interested in incorporating this Ribbon control into a Visual C# Windows Form application in Visual Studio 2012 (as I have done, and ran into errors Sniff | :^) ):

In attempting to include this ribbon into a Windows Forms Application in Visual Studio 2012, the Forms Designer may throw an exception, so please do the following:

1. Following step 2 of this wonderful tutorial (on referencing System.Windows.Forms.Ribbon.dll in a Windows Forms project designed in Visual Studio), right click on the file Form1.cs and choose the option
< > View Code (to open as a script in Visual Studio) and include the following line of code:
C#
using System.Windows.Forms.Ribbon;

It seems to be important to include the above line of code, as Visual C# doesn't appear to be able to infer that you are declaring the newly-referenced and downloaded resource (System.Windows.Forms.Ribbon.dll) for use in this project.

2. If your Properties dock doesn't include options for Add Tab, etc (as depicted in Part 2 of the article above), right click on an option in the Properties panel and check the Commands option in the pop-up balloon.

(*P.S. I'm using this control in .NET 2.0).

modified 31-Dec-12 1:08am.

GeneralRe: Resolution of "bugs" Pin
Nag4dotnet30-Dec-12 18:55
Nag4dotnet30-Dec-12 18:55 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K30-Dec-12 21:28
Shiraz S K30-Dec-12 21:28 
GeneralRe: Resolution of "bugs" Pin
adriancs30-Dec-12 21:42
mvaadriancs30-Dec-12 21:42 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K1-Jan-13 23:20
Shiraz S K1-Jan-13 23:20 
GeneralRe: Resolution of "bugs" Pin
adriancs2-Jan-13 2:06
mvaadriancs2-Jan-13 2:06 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K3-Jan-13 0:50
Shiraz S K3-Jan-13 0:50 
GeneralRe: Resolution of "bugs" Pin
adriancs3-Jan-13 2:19
mvaadriancs3-Jan-13 2:19 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K3-Jan-13 16:29
Shiraz S K3-Jan-13 16:29 
BugRe: Resolution of "bugs" Pin
Shiraz S K3-Jan-13 16:46
Shiraz S K3-Jan-13 16:46 
GeneralRe: Resolution of "bugs" Pin
adriancs3-Jan-13 17:32
mvaadriancs3-Jan-13 17:32 
GeneralRe: Resolution of "bugs" Pin
adriancs9-Jan-13 18:39
mvaadriancs9-Jan-13 18:39 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K12-Mar-18 18:54
Shiraz S K12-Mar-18 18:54 
GeneralRe: Resolution of "bugs" Pin
adriancs19-Mar-18 17:18
mvaadriancs19-Mar-18 17:18 
GeneralRe: Resolution of "bugs" Pin
adriancs30-Dec-12 19:03
mvaadriancs30-Dec-12 19:03 
GeneralRe: Resolution of "bugs" Pin
Shiraz S K30-Dec-12 21:32
Shiraz S K30-Dec-12 21:32 
GeneralRe: Resolution of "bugs" Pin
adriancs30-Dec-12 22:12
mvaadriancs30-Dec-12 22:12 
QuestionHow to add Short Cut for Tabs And Ribbon Buttons Pin
Nag4dotnet30-Dec-12 18:52
Nag4dotnet30-Dec-12 18:52 

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.