Click here to Skip to main content
15,848,905 members
Articles / Desktop Programming / Windows Forms

Windows Ribbon for WinForms, Part 5 - Application Menu with SplitButton and DropButton

Rate me:
Please Sign up or sign in to vote.
5.00/5 (14 votes)
6 Mar 2010Ms-PL2 min read 33.1K   3.2K   34   1
In this article, I'll present how to use the ribbon application menu with ribbon split button and ribbon drop button controls.

This series of CodeProject articles is based on a series of posts I've first published on my blog.

Today I'll show you how to use the following ribbon features inside a Winforms application:

  • Menu Group
  • Split Button in an Application Menu
  • Drop Down Button in an Application Menu

The result of this post looks like this:


SplitButton VS DropDownButton

What is actually the difference between those two?

DropDownButton is NOT a button, meaning clicking it does nothing. Hovering over it will open a list of buttons.
On the other hand, SplitButton is itself a button, which you can respond to. Hovering over it will also open a list of buttons.

The common use for a DropDownButton is when you want to expose a set of items which doesn't have an obvious default option. Think of “Rotate” feature in Paint. you have Rotate90, Rotate180 and Rotate270 but none of them is an obvious default.

The common use for a SplitButton is when you want to expose a set of items which has an obvious default option. Think of “Save As” button, where there is a default save format.

Using SplitButton and DropDownButton in Ribbon Application Menu

The commands markup is the same as before, just define some command to be listed later in the views markup. For example:
<Command Name="cmdButtonDropA"
    LabelTitle="Drop A"
    LabelDescription="Sub button A"
    TooltipTitle="Drop A">

<Command Name="cmdButtonDropB"
    LabelTitle="Drop B"
    LabelDescription="Sub button B"
    TooltipTitle="Drop B">

The relevant views markup is defined as follows:

<DropDownButton CommandName='cmdDropDownButton'>
  <MenuGroup Class='MajorItems'>
    <Button CommandName='cmdButtonDropA' />
    <Button CommandName='cmdButtonDropB' />
    <Button CommandName='cmdButtonDropC' />

    <Button CommandName='cmdButtonDropB' />
    <MenuGroup Class='MajorItems'>
      <Button CommandName='cmdButtonDropA' />
      <Button CommandName='cmdButtonDropB' />
      <Button CommandName='cmdButtonDropC' />

The code behind section is also the same as in the previous post, just handle IUICommandHandler.Execute with the corresponding ID.
Update (18.11.2009): Just register to the OnExecute event of the corresponding button.


A menu group is a collection of menu items inside the application menu. The most useful feature it provides is giving a title to a group of items, like “File Menu” in the last image.

If you just want a simple separator between menu items, you use a MenuGroup that is not attached to any command.


As always, the most updated version of “Windows Ribbon for WinForms” along with sample applications can be found here.

That’s it for now,
Arik Poznanski.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Written By
Software Developer (Senior) Verint
Israel Israel
Arik Poznanski is a senior software developer at Verint. He completed two B.Sc. degrees in Mathematics & Computer Science, summa cum laude, from the Technion in Israel.

Arik has extensive knowledge and experience in many Microsoft technologies, including .NET with C#, WPF, Silverlight, WinForms, Interop, COM/ATL programming, C++ Win32 programming and reverse engineering (assembly, IL).

Comments and Discussions

QuestionHow can I add menus and submenus in a dropdown button Pin
Célio29-Apr-14 2:50
Célio29-Apr-14 2:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.