Skip to content

RibbonTools basics

harborsiem edited this page Jun 4, 2024 · 5 revisions

RibbonTools Basics

RibbonTools is a toolchain for designing, building and previewing your Windows Ribbon project. This tool does support not only the .NET languages C# and Visual Basic, rather than languages like C++ and others.

Go to the Releases page of this GitHub repository and copy and unzip the latest version of "msi.zip" to your computer. Install the unzipped files "Ribbon.msi" and "RibbonTools.msi". You have also to install the Microsoft Windows SDK and the Visual Studio C++ Tools.

!Note:
The RibbonTools requires 3 Microsoft tools for building the ribbon. These are the Microsoft Ribbon Compiler (UICC.exe), the Microsoft Resource Compiler (RC.exe) and the Microsoft Linker (Link.exe). The Ribbon Compiler, Resource Compiler comes with the Windows SDK. The Linker comes with Visual Studio C++ tools. The RibbonTools should find these tools automatically on startup. However, if it fails to do so, it will show the Settings dialog box where you can specify the location of these tools manually.

Now start the RibbonTools GUI application from the Windows start menu.

RibbonTools Settings

In the Settings dialog one can set options for building the ribbon files. Also, one can set the default size of the “RibbonTools” Application. The settings are stored in your local AppData directory “RibbonTools\Settings.xml”. The paths of the Microsoft compiler and linker tools are auto detected on the first run of the tool. When the default value of “Auto update Tools Path” is set, then the linker path is updated automatically if necessary on every start of the RibbonTools. Normally the user has nothing to do with this stuff.

The C# Wrapper generate a file named RibbonItems.Designer.cs and the Visual Basic Wrapper generate a file named RibbonItems.Designer.vb. You can use one of these files for the code behind of the ribbon controls. With optional setting switch "Wrapper class name like Markup file instead RibbonItems" one can generate a wrapper file and class name like the markup file.

When you are using RibbonTools for a project written in C++ or some other languages, then you need the *.rc or *.res files. So, you can unselect “Delete *.rc, *.res files”. If your Ribbon application should only run on Windows 8 or newer, then you can select “Allow *.png Images” for the ribbon image files in the markup. For C++ or some other languages, it might be useful to set another ResourceName (Property ResourceIdentifier in the Ribbon class). This is not recommended when you use the ribbon.dll with C# or Visual Basic.

RibbonTools from command line

You can also use the RibbonTools from command line, batch file, … for building the ribbon files. The possible command parameters are listed when you call RibbonTools /?.

For building the ribbon files you have to call

  1. RibbonTools path_to_markup_file --build

or

  1. RibbonTools path_to_markup_file APPLICATION --build

APPLICATION means it is the ResourceName for the generated ribbon files. You can also use an other name. This feature you should not use with .NET WinForms.

path_to_markup_file means the full path of the RibbonMarkup.xml file.

Table of contents

Clone this wiki locally