HypernovaDesktop Components · docs
Binarymission
WinForms › Checked Image List Combobox

Checked Image List Combobox

.NET Framework 4.8.NET 6 / 8 / 10v3.0.0WinForms

A combo box whose drop-down is a checked list of rich items – a title, a line of text and an image on each – so the user can pick several, and the closed box lists the ones picked.

2public types
186public members
1namespaces

Assembly

AssemblyBinarymission.WinForms.Controls.MultiSelectableCheckedImageListCombobox.dll
Root namespaceBinarymission.WinForms.Controls.Containers
Target frameworks.NET Framework 4.8, .NET 6 / 8 / 10
Depends onBinaryComboBox, CheckedImageListBox, CommonUtils

Overview

Items

The items, and the look of the drop-down list, belong to MultiSelectableCheckedImageListBoxConfiguration: add CheckedImageListBoxItem objects to its CheckedImageListBoxConfiguration.Items. They are copied into the drop-down each time it opens, so a change shows from the next open. A check the user makes is kept on the item itself.

What the box shows

The text area is read-only. It lists the checked items – each one's DisplayMember property if you name one, otherwise its title, otherwise its content text – separated by CheckedItemTextDisplaySeparationDelimiterChars. It is rebuilt when the user checks or unchecks an item and when ToggleCheckStateForAllItems is set.

The drop-down

It opens below the box at DropdownSize, with a band underneath that the user can drag to make it taller or wider. Clicking an item toggles its check box; the drop-down stays open until the user clicks elsewhere.

Reading the choice

Handle ItemCheckStateChanged, or read CheckedItems or CheckedIndices. Both are read from the drop-down list, so they are empty until the drop-down has opened once (or ToggleCheckStateForAllItems has been set); before that, read each item's CheckedImageListBoxItem.IsChecked.

Getting started

Pizza toppings, chosen together and shown in the box as "Mushrooms + Olives".

var toppings = new MultiSelectableCheckedImageListCombobox
{
    Width = 320,
    DropdownSize = new Size(320, 260),
    CheckedItemTextDisplaySeparationDelimiterChars = "+"
};

CheckedImageListBoxConfiguration list = toppings.MultiSelectableCheckedImageListBoxConfiguration;
list.Items.Add(new CheckedImageListBoxItem { Title = "Mushrooms", ContentText = "Chestnut, sliced" });
list.Items.Add(new CheckedImageListBoxItem { Title = "Olives", ContentText = "Kalamata, pitted" });
list.Items.Add(new CheckedImageListBoxItem { Title = "Peppers", ContentText = "Roasted red" });

toppings.ItemCheckStateChanged += (sender, e) =>
    orderSummary.Text = toppings.CheckedItems.Count + " toppings";

Controls.Add(toppings);

API reference

Binarymission.WinForms.Controls.Containers

class CheckedImageListBoxConfigurationThe items and the look of the list that drops down from a MultiSelectableCheckedImageListCombobox.
class MultiSelectableCheckedImageListComboboxA combo box whose drop-down is a checked list of rich items - a title, a line of text and an image on each - so the user can pick several, and the closed box lists the ones picked.