Reputation: 9297
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
Upvotes: 3
Views: 12413
Reputation: 602
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"
});
Upvotes: 1
Reputation: 24404
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.
Upvotes: 0
Reputation: 15566
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:
Upvotes: 10