Click here to Skip to main content
Click here to Skip to main content

Tagged as

Easily Add a Ribbon into a WinForms Application (C#)

, , , , 23 Nov 2013 Ms-PL
Rate this:
Please Sign up or sign in to vote.

Style 2007  

Style 2010 

Style 2013 


Part 1: Background 





Part 2: How to Use this Ribbon Control    






1. Get System.Windows.Forms.Ribbon35.dll from download.

2. Create a blank WinForms project.

3. Add Ribbon into Visual Studio Toolbox.

Right Click on Toolbox > Add Tab.

Give the new tab a name "Ribbon".






Another Way

Manually code it behind.

You can add the ribbon into WinForm too with code behind.



Add these three lines of code 

private System.Windows.Forms.Ribbon ribbon1;
ribbon1 = new System.Windows.Forms.Ribbon();

into Form1.Designer.cs 

private void InitializeComponent()
    ribbon1 = new System.Windows.Forms.Ribbon();
    this.components = new System.ComponentModel.Container();
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.Text = "Form1";
private System.Windows.Forms.Ribbon ribbon1; 

Save and Close Form1.Designer.cs.  



Lets continue... 

4. Click on the Ribbon and click Add Tab.  








7. Try to add some buttons into the RibbonPanel.

8. Click on the RibbonButton, go to Properties


10. This is how your ribbon looks like now.




13. Events created.

public Form1()

void cmdNew_Click(object sender, EventArgs e)

void cmdSave_Click(object sender, EventArgs e)

14. Press F5 to run the application. Done.




public partial class Form1 : Form

to RibbonForm 

public partial class Form1 : RibbonForm

Part 3: Caution While Using With Visual Studio 2010 

... deleted ....  

Part 4: Using this Ribbon with an MDI Enabled WinForm 









public partial class Form1 : Form
    public Form1()

    protected override void OnLoad(EventArgs e)
        this.ControlBox = false;
        this.WindowState = FormWindowState.Maximized;



public partial class MainForm : RibbonForm
    public MainForm()

    private void ribbonButton_Form1_Click(object sender, EventArgs e)
        // Load Form1

    private void ribbonButton_Close_Click(object sender, EventArgs e)
        // Close All Forms

5. Codes for loading Form1 into MDI:

private void ribbonButton_Form1_Click(object sender, EventArgs e)
    foreach (Form f in this.MdiChildren)
        if (f.GetType() == typeof(Form1))
    Form form1 = new Form1();
    form1.MdiParent = this;

6. Codes for closing all opened form in MDI:

private void ribbonButton_Close_Click(object sender, EventArgs e)
    while (this.ActiveMdiChild != null)

7. That's it. Enjoy. 

Part 5: Alternative Ribbon  

You may also want to have a look at:  


Default Theme


Another custom theme


  2. Change all the color objects into your desired colors. 

    In this example, we'll name the new theme MyCoolThemeSkin.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Drawing;
    namespace System.Windows.Forms
        public class MyCoolThemeSkin
            : RibbonProfesionalRendererColorTable
            public MyCoolThemeSkin()
                #region Fields
                OrbDropDownDarkBorder = Color.Yellow;
                OrbDropDownLightBorder = Color.FromKnownColor(KnownColor.WindowFrame);
                OrbDropDownBack = Color.FromName("Red");
                OrbDropDownNorthA = FromHex("#C2FF3D");
                OrbDropDownNorthB = Color.FromArgb(201, 100, 150);
                OrbDropDownNorthC = 
                OrbDropDownNorthD = 
                OrbDropDownSouthC = 
                OrbDropDownSouthD = 
                OrbDropDownContentbg = 
                OrbDropDownContentbglight = 
                OrbDropDownSeparatorlight = 
                OrbDropDownSeparatordark = 
                Caption1 = 
                Caption2 = 
                Caption3 = 
                Caption4 = 
                Caption5 = 
                Caption6 = 
                Caption7 = 
                QuickAccessBorderDark = 
                QuickAccessBorderLight = 
                QuickAccessUpper = 
                QuickAccessLower = 
                OrbOptionBorder = 
                OrbOptionBackground = 
                OrbOptionShine = 
                Arrow = 
                ArrowLight = 
                ArrowDisabled = 
                Text = 
                RibbonBackground = 
                TabBorder = 
                TabNorth = 
                TabSouth = 
                TabGlow = 
                TabText = 
                TabActiveText = 
                TabContentNorth = 
                TabContentSouth = 
                TabSelectedGlow = 
                PanelDarkBorder = 
                PanelLightBorder = 
                PanelTextBackground = 
                PanelTextBackgroundSelected = 
                PanelText = 
                PanelBackgroundSelected = 
                PanelOverflowBackground = 
                PanelOverflowBackgroundPressed = 
                PanelOverflowBackgroundSelectedNorth = 
                PanelOverflowBackgroundSelectedSouth = 
                ButtonBgOut = 
                ButtonBgCenter = 
                ButtonBorderOut = 
                ButtonBorderIn = 
                ButtonGlossyNorth = 
                ButtonGlossySouth = 
                ButtonDisabledBgOut = 
                ButtonDisabledBgCenter = 
                ButtonDisabledBorderOut = 
                ButtonDisabledBorderIn = 
                ButtonDisabledGlossyNorth = 
                ButtonDisabledGlossySouth = 
                ButtonSelectedBgOut = 
                ButtonSelectedBgCenter = 
                ButtonSelectedBorderOut = 
                ButtonSelectedBorderIn = 
                ButtonSelectedGlossyNorth = 
                ButtonSelectedGlossySouth = 
                ButtonPressedBgOut = 
                ButtonPressedBgCenter = 
                ButtonPressedBorderOut = 
                ButtonPressedBorderIn = 
                ButtonPressedGlossyNorth = 
                ButtonPressedGlossySouth = 
                ButtonCheckedBgOut = 
                ButtonCheckedBgCenter = 
                ButtonCheckedBorderOut = 
                ButtonCheckedBorderIn = 
                ButtonCheckedGlossyNorth = 
                ButtonCheckedGlossySouth = 
                ItemGroupOuterBorder = 
                ItemGroupInnerBorder = 
                ItemGroupSeparatorLight = 
                ItemGroupSeparatorDark = 
                ItemGroupBgNorth = 
                ItemGroupBgSouth = 
                ItemGroupBgGlossy = 
                ButtonListBorder = 
                ButtonListBg = 
                ButtonListBgSelected = 
                DropDownBg = 
                DropDownImageBg = 
                DropDownImageSeparator = 
                DropDownBorder = 
                DropDownGripNorth = 
                DropDownGripSouth = 
                DropDownGripBorder = 
                DropDownGripDark = 
                DropDownGripLight = 
                SeparatorLight = 
                SeparatorDark = 
                SeparatorBg = 
                SeparatorLine = 
                TextBoxUnselectedBg = 
                TextBoxBorder = 
            public Color FromHex(string hex)
                if (hex.StartsWith("#"))
                    hex = hex.Substring(1);
                return Color.FromArgb(
                    int.Parse(hex.Substring(0, 2), system.Globalization.NumberStyles.HexNumber),
                    int.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber),
    namespace RibbonDemo
        public partial class MainForm : RibbonForm
            public MainForm()
            private void ChangeTheme()
                Theme.ColorTable = new MyCoolThemeSkin();

Part 7: Known Issues  

Are resolved.

Article Change Log: 









11 Apr 2012 - Initial release.




About the Authors


United States United States
No Biography provided

Software Developer (Senior)
Austria Austria
No Biography provided

Software Developer
Malaysia Malaysia
Writing programs is an art.

Michael Spradlin
Software Developer (Senior)
United States United States
Follow on   Google+

Comments and Discussions

AnswerRe: minimized ribbon PinmembertoATwork7-Feb-13 23:24 
AnswerRe: minimized ribbon PinmembertoATwork15-Feb-13 0:59 
QuestionWindows7 64 bit with Visual Studio 2010 Not working Pinmembertamilpuyal_286-Feb-13 20:42 
AnswerRe: Windows7 64 bit with Visual Studio 2010 Not working PinmembertoATwork7-Feb-13 0:15 
QuestionProblem in Windows XP Pinmemberjintopaul5-Feb-13 0:09 
AnswerRe: Problem in Windows XP Pinmvpadriancs5-Feb-13 14:51 
AnswerRe: Problem in Windows XP Pinmvpadriancs5-Feb-13 15:20 
BugError when loading MDI screen PinmemberCorvetteGuru4-Feb-13 9:27 
I am using VB 2010, Ultimate... and all of a sudden, when I try to edit the form I get some unknown load error. At one point, windows32.dll (I think), was blamed, but it keeps coming back.
I can edit the form, run the program, but try to load the graphical portion of the screen. kaboom!
I added a couple of tabs, then ribbon panels and then buttons, ever since... this blasted load error.
I downloaded the Jan 13 build... and it was working great until today. I also restarted my computer with little success - Dell Precision T3500.
Any ideas?
GeneralRe: Error when loading MDI screen Pinmvpadriancs5-Feb-13 14:53 
GeneralRe: Error when loading MDI screen PinmemberCorvetteGuru8-Feb-13 14:43 
GeneralMy vote of 5 Pinmembergokude4-Feb-13 0:02 
GeneralRe: My vote of 5 Pinmembersupernorb8-Feb-13 18:00 
QuestionTag of RibbonItem, RibbonPanel and RibbonTab Pinmembergokude3-Feb-13 23:28 
AnswerRe: Tag of RibbonItem, RibbonPanel and RibbonTab PinmembertoATwork4-Feb-13 3:31 
AnswerRe: Tag of RibbonItem, RibbonPanel and RibbonTab Pinmembergokude5-Feb-13 5:48 
SuggestionRe: Tag of RibbonItem, RibbonPanel and RibbonTab PinmembertoATwork7-Feb-13 23:38 
QuestionFacing an issue while build or run. [modified] Pinmemberjintopaul3-Feb-13 19:02 
QuestionRe: Facing an issue while build or run. PinmembertoATwork5-Feb-13 0:51 
AnswerRe: Facing an issue while build or run. Pinmemberjintopaul12-Feb-13 23:08 
QuestionRe: Facing an issue while build or run. PinmembertoATwork12-Feb-13 23:09 
QuestionSplitDropDown in QuickAccessToolbar Pinmembergokude29-Jan-13 23:27 
AnswerRe: SplitDropDown in QuickAccessToolbar PinmembertoATwork1-Feb-13 5:09 
GeneralRe: SplitDropDown in QuickAccessToolbar Pinmembergokude3-Feb-13 22:40 
BugOrb Menu Items not working PinmemberMember 888448828-Jan-13 9:21 
GeneralRe: Orb Menu Items not working PinmembertoATwork1-Feb-13 4:13 



| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 23 Nov 2013
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid