WPF ComboBox Control


The ComboBox control enables users to select one item from a list of items. It’s nice because it doesn’t occupy much space because it displays only the current selection in a selection box, with the rest of the list shown on demand in a drop-down. The ComboBox defines two events: DropDownOpened, DropDownClosed and a property, IsDropDownOpen. If you wish, you can delay the filing of the ComboBox items until the drop-down is opened by handling the DropDownOpened event. IsDropDownOpen is a read/write property, so you can set it directly to change these state of the drop-down.

Since the ComboBoxItem is a ContentControl, we can actually use pretty much anything as content. We don’t just have to use plain text for each of the selectable items.

Here is an older post on ComboBox.