Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF ListBox vs ComboBox

I'm working on an application with C# and WPF, in which I need to bind to a dictionary and display key-value pairs. How are ListBoxes different from ComboBoxes, and what are some possible advantages/disadvantages of using one over the other?

like image 672
Verbal Kint Avatar asked Jul 22 '16 13:07

Verbal Kint


1 Answers

A ComboBox is a combination of listbox and edit control. A simple combobox is just a listbox with an edit control at the top; you can select from the list or type. a combobox with style "dropdown" is the same, but the listbox doesn't show up until you click the dropdown glyph. You can dropdown and select or just type in the edit control. a combobox with dropdownlist style is similar, but you can only select from the list presented - you can't type in what you want in the edit control.

Basically, a combobox (non simple style) takes up a lot less screen realestate than a full-on listbox.

Source : https://social.msdn.microsoft.com/Forums/en-US/3b5be60d-36c5-49aa-b49e-aa8625f53b62/what-is-the-difference-between-listbox-and-combobox-control?forum=netfxcompact

List Box :

  1. Occupies more space but shows more than one value.

  2. We can select multiple items.

  3. we can use checkboxes with in the list box.

Combo Box:

  1. Occupies less space but shows only one value for visibility

  2. Multiple select is not possible

  3. can't use checkboxes within combo boxes

Also have a look at http://devproconnections.com/aspnet/dropdownlist-listbox-and-combobox-whats-difference

like image 115
ViVi Avatar answered Oct 03 '22 23:10

ViVi