Docs / UI

Glossary: ComboBox Style

The properties, methods and events of ComboBox, in alphabetical order.

Color legend plain property dependency property method event

A selection image, a toggle button and a drop-down list box: the closed combo box shows the selected row, the open one lists all rows to choose from.

ComboBox derives from BaseElement and has its members too. The lists and menus page shows it in context, with code and screenshots.

Names are colored by what they are: a plain property, a method, an event or a dependency property, which a style, a binding or an animation can set.

Properties

GeneralMouseCursorsSet 馃爢

MouseCursorsSet 路 Static. The cursors of every element of this style type; null (the default) falls back to DefaultMouseCursorsSet.

GeneralStyle 馃爢

ComboBoxStyle 路 Static. The style of every element of this style type. It starts as a copy of the framework defaults; changing one of its properties updates every such element, a property it leaves unset takes its default.

Items 馃爢

IReadOnlyList<ListBoxItem> 路 Read-only. The rows of the drop-down list that have an element (see the list box鈥檚 Items).

ItemsSource 馃爢

IEnumerable 路 The objects to show, one row each. A BindableCollection<T> is followed.

ItemsTemplate 馃爢

IItemsTemplate 路 Makes the element of each ItemsSource object; a label with the object鈥檚 text when none is set.

ListBoxStyle 馃爢

ListBoxStyle 路 The style of the drop-down list, for example its row colors.

MouseCursorsSet 馃爢

MouseCursorsSet 路 Read-only. The cursors the element shows: its override, else the set given to the control it is a part of, else its type鈥檚 general set, else DefaultMouseCursorsSet.

MouseCursorsSetOverride 馃爢

MouseCursorsSet 路 The cursors of this element only, passed on to its parts that have none of their own.

SelectedIndex 馃爢

int 路 The index of the selected row, -1 when nothing is selected.

SelectedItem 馃爢

ListBoxItem 路 The selected row, null when nothing is selected. Setting it selects that row.

SelectedSource 馃爢

object 路 Read-only. The ItemsSource object of the selected row, null without one.

SelectionStyle 馃爢

ImageStyle 路 The style of the image that shows the selected row. The image is only as large as the row鈥檚 content, so a background color here lies just behind the chosen value; the combo box鈥檚 own BackgroundColor colors the whole field.

StyleOverride 馃爢

ComboBoxStyle 路 A style for this element only, applied over the general style. Setting it to null takes its values back out.

ToggleButtonStyle 馃爢

ButtonStyle 路 The style of the button that opens and closes the list, for example its width and text. Unless set, a button 24 units wide (DefaultSettings.DefaultComboBoxToggleButtonWidth) with the text v, in the colors of the other buttons.

Methods

ComboBox() 馃爢

ComboBox(string name = null) 路 Creates a combo box. The name is used by GetElementByName.

Parameter Type Description
name string The element鈥檚 Name, which GetElementByName finds it by. Default: null.

AddItem() 馃爢

AddItem(BaseElement item) 路 Adds a row at the end of the list.

Parameter Type Description
item BaseElement The element to add.

AddItemAt() 馃爢

AddItemAt(BaseElement item, int index) 路 Inserts a row at the index.

Parameter Type Description
item BaseElement The element to insert.
index int The position to insert it at: 0 for the first, the number of items for the end.

AddItemsRange() 馃爢

AddItemsRange(IEnumerable<BaseElement> items) 路 Adds a row per element at the end, in one batch.

Parameter Type Description
items IEnumerable<BaseElement> The elements to add, in order.

AddItemsRangeAt() 馃爢

AddItemsRangeAt(IEnumerable<BaseElement> items, int index) 路 Inserts a row per element at the index, in one batch.

Parameter Type Description
items IEnumerable<BaseElement> The elements to insert, in order.
index int The position of the first one: 0 for the first, the number of items for the end.

AddTextItem() 馃爢

AddTextItem(string text) 路 Adds a text row. Does nothing while an ItemsSource is set.

Parameter Type Description
text string The text of the row.

ClearItems() 馃爢

ClearItems() 路 Removes every row.

Deselect() 馃爢

Deselect(BaseElement item) 路 Deselects the row of the item.

Parameter Type Description
item BaseElement The element whose row is deselected.

DeselectAt() 馃爢

DeselectAt(int index) 路 Deselects the row at the index.

Parameter Type Description
index int The index of the row to deselect.

RemoveItem() 馃爢

RemoveItem(BaseElement item) 路 Removes the row of the item.

Parameter Type Description
item BaseElement The element to take out.

RemoveItemAt() 馃爢

RemoveItemAt(int index) 路 Removes the row at the index.

Parameter Type Description
index int The index of the item to take out.

RemoveItemsRangeAt() 馃爢

RemoveItemsRangeAt(int index, int count) 路 Removes count rows from the index on.

Parameter Type Description
index int The index of the first item to take out.
count int The number of items to take out.

Select() 馃爢

Select(BaseElement item) 路 Selects the row of the item.

Parameter Type Description
item BaseElement The element whose row is selected.

SelectAt() 馃爢

SelectAt(int index) 路 Selects the row at the index.

Parameter Type Description
index int The index of the row to select.

SelectNext() 馃爢

SelectNext() 路 Selects the next row (separators passed over). Does nothing without a selection.

SelectPrevious() 馃爢

SelectPrevious() 路 Selects the previous row (separators passed over). Does nothing without a selection.

SelectSource() 馃爢

SelectSource(object source) 路 Selects the row of the ItemsSource object. Nothing happens when there is none.

Parameter Type Description
source object The ItemsSource object whose row is selected.

Events

OnItemSelect 馃爢

(BaseElement sender, ListBoxItem item) 路 The selection changes, by the user or from code. The sender is the combo box, item a row of its drop-down list, null when nothing is selected any more.

Parameter Type Description
sender BaseElement The list box, or the combo box whose drop-down list it is.
item ListBoxItem The primary selected row, or null when nothing is selected any more.