WPF ListBox vs ComboBox

12,381

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

Share:
12,381
Verbal Kint
Author by

Verbal Kint

Updated on June 22, 2022

Comments

  • Verbal Kint
    Verbal Kint almost 2 years

    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?

  • Verbal Kint
    Verbal Kint almost 8 years
    Great thanks! Now is there some compromise between the two? Say for example that I want to show all values, but I don't need the user to select anything. Just a basic control that binds to the dictionary
  • ViVi
    ViVi almost 8 years
    If you don't want user to select anything then why do you need to do a listbox or combobox? It's basically used in cases where user can select a particular item and you can show some information regarding that selected item. If you don't want user to select an item, simply create a grid and display the data.
  • Verbal Kint
    Verbal Kint almost 8 years
    Gotcha, thanks! Although binding to a collection requires a datagrid as opposed to a run-of-the-mill grid
  • adminSoftDK
    adminSoftDK almost 8 years
    @IDisposable multiple select is possible if you modify the template of the combobox.
  • ViVi
    ViVi almost 8 years
    @adminSoftDK : yes I agree to that. I was saying the basic difference. We could obviously define templates to change the look and behavior.