Quickstart Tutorial: Windows Ribbon for WinForms

Here I will show you how you can start using the Windows Ribbon from CodePlex.

Prepare your developer machine

Installation of Windows 7 SDK is required to create and modify the ribbon on a developer machine.

1. Download latest version of RibbonLib from CodePlex

You can find the library here: http://windowsribbon.codeplex.com/

2. Build the RibbonGenerator setup and install it.

Start the Visual Studio 2010 Solution of RibbonGenerator, set the build configuration to Release and build it twice!
After the second build it will compile without errors! This is an official Visual Studio 2010 bug and we have to live with it.

.\RibbonLib_v2.6\RibbonGenerator\RibbonGenerator.sln

Now you can install the new setup file that you will find here…

.\RibbonLib_v2.6\RibbonGenerator\RibbonGenerator.Setup\Release\RibbonGenerator.Setup.msi

3. Compile a Ribbon.dll

To get a compiled version of Ribbon.dll start the sample solution and build it using Visual Studio

.\RibbonLib_v2.6\Ribbon-cs.sln

4. Create a new Windows Forms application containing the Ribbon Control.

Add the Ribbon to your Toolbox doing a right-click on Toolbox / Choose Items
.\RibbonLib_v2.6\Ribbon\bin\Release\Ribbon.dll

Drag/Drop the Ribbon to your form

For your body you can add a Panel control and set the DockStyle property to Fill

Add a new Xml file to your Project and rename to Ribbon.xml

Add the following content to the file.

<?xml version='1.0' encoding='utf-8'?>
<Application xmlns='http://schemas.microsoft.com/windows/2009/Ribbon'>
	<Application.Commands>
	</Application.Commands>

	<Application.Views>

		<Ribbon>
		</Ribbon>
	</Application.Views>
</Application>

Set the CustomTool of the Ribbon.xml in the File Properties to RibbonGenerator to generate a .ribbon file.

Now you need to specify the .ribbon file in the Ribbon control properties on your form. The name must be the full name including the namespace.

That’s all. So have a lot of fun playing with the samples included in the download package too.

Follow

Get every new post delivered to your Inbox.