Tag Archives: Controls

Split Button Control

What is a split button?

In the previous post we presented the command link button control that is one of the controls introduced with Windows Vista. Another such control is the split button. This is a button that:

  • act like a regular button when pressed, but
  • display a drop-down menu when its drop-down arrow is presses

This is actually a regular button that has one of the windows styles BS_SPLITBUTTON or BS_DEFSPLITBUTTON set.

Split button control

How do add a split button

If you work with Microsoft Visual Studio 2008 or newer then you can find “Split Button Control” in the resource editor toolbox. First step is to drag it from toolbox in the resource dialog template.

Split Button Control

You can set the caption and the handler for BN_CLICKED just like with any regular push button.

However, for the drop down menu you have to define it explicitly.

Split button drop down menu

To specify what is the menu to be displayed use SetDropDownMenu.

Then, add handlers for the menu items and handle the commands.