Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms -- multi select dropdown list

Tags:

I'm shopping around for a dropdown list control that allows me to select multiple items. Something akin to the CheckedListbox, but in dropdown list form (I don't want it to take up a big chunk of the screen). At this point I'm pretty convinced there is no such control built-in .NET.

Note this is Winforms, not ASP.NET. Any suggestions?

like image 598
AlanR Avatar asked Jun 25 '10 13:06

AlanR


2 Answers

Check out this project on CodeProject:

  • CheckBox ComboBox Extending the ComboBox Class and Its Items
like image 79
Jim Lamb Avatar answered Oct 03 '22 17:10

Jim Lamb


There is yet another fix:

The above solution is correct to fix the first issue, where it required two clicks to enter the list of checkboxes, however, this introduces a new issue when you click the control to exit it, it retains focus and you must double click to go to another control. I was able to fix this with the following code:

In CheckBoxComboBox.cs add the following override:

    protected override void OnClick(EventArgs e)     {         base.OnClick(e);         this.Parent.Focus();     } 

With the answer from Rob P. and this answer, it will not hold focus on either click event.

like image 36
Steve Stokes Avatar answered Oct 03 '22 15:10

Steve Stokes