Overview

You can build Windows Ribbon Framework without using ProRibbon. (E.g. if you run from build server.) Read carefully and adapt your paths to reference vsvarall.bat-paths to link and build resource. Also reference Windows Ribbon SDK Uicc.exe. The recommend way is to build with ProRibbon. Some nice features are not available from commandline (not functional only comfort).

You can build Windows Ribbon Framework without using ProRibbon. (E.g. if you run from build server.) Read carefully and adapt your paths to reference vsvarall.bat-paths to link and build resource. Also reference Windows Ribbon SDK Uicc.exe. The recommend way is to build with ProRibbon. Some nice features are not available from commandline (not functional only comfort).

Input files

  • Form1.cs
  • ribbon.xml

ribbon.xml

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://schemas.microsoft.com/windows/2009/Ribbon">
    <Application.Commands>
        <Command Name="Command1" LabelTitle="Test 1" Id="3"></Command>
        <Command Name="Command2" LabelTitle="Test 2" Id="4"></Command>
    </Application.Commands>
    <Application.Views>
        <Ribbon GroupSpacing="Small">
            <Ribbon.Tabs>
                <Tab>
                    <Group SizeDefinition="TwoButtons">
                        <Button CommandName="Command1" />
                        <Button CommandName="Command2" />
                    </Group>
                </Tab>
            </Ribbon.Tabs>
        </Ribbon>
    </Application.Views>
</Application>

Build on command line

uicc.exe "ribbon.xml" "output.bml" /res:"ribbonresource.rc"
RC.Exe /v "ribbonresource.rc"
link.exe" /VERBOSE /NOENTRY /DLL /OUT:"ribbon.dll" "ribbonresource.res")
edit commands

Prepare Visual Studio (any version .NET greater than 3.5)

  • Add ribbon.dll as resource to your Winforms project.
  • Add ribbon control to your winforms form.
  • Add partial class to your winforms form.
  • Fill partial class with code in next listening.

Partial class in Winforms Form

protected override OnLoad(EventArgs e)
{
	base.OnLoad(e);
	this.InitRibbonLib(this.ribbon)
}

private void InitRibbonLib(RibbonLib.Ribbon ribbon)
{
	ribbon.ResourceName = ribbonResource;
    var buttonCommand1 = new RibbonButton(ribbon, 3);
	var buttonCommand2 = new RibbonButton(ribbon, 4);
    // ... put in any code to initialize buttons
}

Compile and run Winforms Application

edit commands