3

I have seen comboBoxes that looks like buttons with a small arrow to the right at the bottom, indicating that it's a drow down menu with several options. How is this done? Is there something I can change in the properties of the comboBox? Thanks!

EDIT: I'm using Windows Forms in Visual Studio 2010

H H
  • 263,252
  • 30
  • 330
  • 514
3D-kreativ
  • 9,053
  • 37
  • 102
  • 159
  • 1
    For WinForms there is nothing out of the box. You could find this kind of control in controls suite offered by Infragistics, DevExpress, Telerik and probably others. (For example Infragistics has a control kind name UltraDropDownButton) – Steve Apr 16 '12 at 09:33

4 Answers4

10

This is called SplitButton and in .NET you have this available for toolbars but not for use in normal WinForms.

However, there are some alternatives such as:

  1. This one on Codeproject
  2. Another on CodeProject
  3. Another one here
Aamir
  • 14,882
  • 6
  • 45
  • 69
1
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] 
{
    "Item 1",
    "Item 2",
    "Item 3",
    "Item 4",
    "Item 5"
});
Mo Patel
  • 2,321
  • 4
  • 22
  • 37
Sadaf
  • 592
  • 2
  • 11
0

ComboBox.DropDownStyle = ComboBoxStyle.DropDownList try this

asdasdad
  • 832
  • 3
  • 15
  • 27
0

I know the OP asked about a SplitButton for WinForms, but WinForms is not mentioned in the post's title so people looking for a Split Button to use with other technologies might end up here.

If you are looking for a Split Button in WPF then you can use the SplitButton provided free in the WPF Extended Toolkit.

Here's a little screen shot of how I used it in my WPF app.

enter image description here

deadlydog
  • 22,611
  • 14
  • 112
  • 118