Table of Contents

Class ColorListBox

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

StdListBox descendant for selecting Color values.

public class ColorListBox : VirtualListBox, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, INotifyDataErrorInfo, IReadOnlyStrings, IListControlItemContainer, IListControlItemDefaults, ICheckListBox<ListControlItem>, ICustomListBox<ListControlItem>, IListControl<ListControlItem>, IListControl, IControl, IDisposable, IWin32Window, ILayoutItem, IScrollEventRouter, IListBoxActions
Inheritance
ColorListBox
Implements

Remarks

Items in this control have ListControlItem type where Value is Color and Text is label of the color.

Constructors

ColorListBox()

Initializes a new instance of the ColorListBox class.

ColorListBox(Control)

Initializes a new instance of the ColorListBox class.

ColorListBox(bool)

Initializes a new instance of the ColorListBox class.

Fields

DefaultDisabledImageColor

Gets or sets default disabled image color.

InitColors

Gets or sets method that initializes items in ColorListBox.

PaintColorImage

Gets or sets method that paints color image in the item. Borders around color image are also painted by this method.

Painter

Gets or sets default painter for the ColorListBox items.

Properties

DisabledImageColor

Gets or sets disabled image color.

UseDisabledImageColor

Gets or sets whether to use DisabledImageColor for painting of the color image when control is disabled.

Value

Gets or sets the selected color. Color value must be added to the list of colors before selecting it.

Methods

AddColor(Color?, string?)

Adds color to the list of colors.

AddColors(KnownColorCategory[]?, bool)

Adds colors from the specified color categories.

CreateItem(Color?, string?)

Creates item for the specified color and title.

DefaultCreateItem(Color?, string?)

Default method of the item creation for the specified color and title.

Find(Color?)

Finds item with the specified color.

Find(Color?, IEnumerable)

Finds item with the specified color in the collection of the color items.

FindOrAdd(Color?, string?)

Finds item with the specified color or adds it.

FindOrAddColor(Color?, string?)

Finds an existing color that matches the specified value or adds a new color if no match is found.

GetItemValue(ListControlItem?)

Retrieves the value of the specified item as a Color object.

GetItemValueOrDefault(IListControl, int, Color)

Gets color value of the specified item or default color.

InitDefaultColors(ColorListBox)

Adds color items to the ColorListBox. This is default implementation of the initialization method. It is assigned to InitColors property by default.

Initialize(bool)

Initializes control with default colors and assigns item painter. This method is called from constructor.

PaintDefaultColorImage(Graphics, RectD, Color)

Paints color image in the item with the default style. Borders around color image are also painted by this method. This is default value of the PaintColorImage field.