This article explain how to embed the Professional Ribbon on the non-client area of the window. You may first download the latest release of the ribbon (release 0.4) needed.
Sure it looks great and it's quite easy to make it work.
As you may see in the pictures above, it renders glass on Vista with Aero enabled and he whole form in any other case.
There are two ways to achieve it:
- Inherit from
RibbonForm
- Implement
IRibbonForm
Both options are really simple. Well the first one is simpler :)

Option 1: Inherit from RibbonForm
Inherit the form where you will host the ribbon from Sytem.Windows.Forms.RibbonForm
public partial class Form1 : RibbonForm
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
And now this form will host the ribbon embedded on the non-client area.
Option 2: Implementing IRibbonForm
I know that sometimes you just can't inherit from RibbonForm since you may have to inherit from other form by any means.
The solution is to implement the Sytem.Windows.Forms.IRibbonForm interface and bypassing some methods to a classs named RibbonHelper.
In fact just make sure your form accomplishes to have this code at least:
using System.Windows.Forms.RibbonHelpers;
public class MyForm
: Form, IRibbonForm
{
private RibbonFormHelper _helper;
public RibbonForm()
{
if (WinApi.IsWindows && !WinApi.IsGlassEnabled)
{
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.Opaque, WinApi.IsGlassEnabled);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
DoubleBuffered = true;
}
_helper = new RibbonFormHelper(this);
}
protected override void WndProc(ref Message m)
{
if (!Helper.WndProc(ref m))
{
base.WndProc(ref m);
}
}
public RibbonFormHelper Helper
{
get { return _helper; }
}
}
- The code on the constructor initializes necessary styles to make the form look good on repainting and stuff like that.
- The code on WndProc passes the WndProc to the Helper to make the ribbon able to fit the non-client area.
- The Helper property is implemented because of
IRibbonForm
Note: If any of the code above is missing the results can become messy.
Important things to consider
When embedding the Ribbon on the non-client area, some graphic glitches are yet to be solved, but it works pretty fine for now.
The method explanied on my Non-client area article is used to embed the Ribbon, so you may remember that the actual non-client area of the form disappears, is only an illusion. The pixel at (0,0) of the form is the absolute top and left most of the form, including the borders and margins.
The Form will be themed even when the windows themes are turned off.
- If you disable Aero when the app is running, the form is not capable of switching, graphical glitches will be visible.
Stay tunned