Table of Contents

Class VirtualListControl

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

Advanced list control with ability to customize item painting.

public abstract class VirtualListControl : ListControl<ListControlItem>, IBaseObjectWithId, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, INotifyDataErrorInfo, IReadOnlyStrings, IListControlItemContainer, IListControlItemDefaults, ICheckListBox<ListControlItem>, ICustomListBox<ListControlItem>, IListControl<ListControlItem>, IControl, IDisposable, IWin32Window
Inheritance
VirtualListControl
Implements
Derived

Fields

DefaultCurrentItemBorderColor

Gets or sets default border color for the current item. This is used when DefaultCurrentItemBorder is created.

DefaultDisabledItemTextColor

Gets or sets default disabled item text color.

DefaultItemMargin

Gets or sets default item margin.

DefaultItemTextColor

Gets or sets default item text color.

DefaultMinItemHeight

Gets or sets default minimal item height.

DefaultSelectedItemBackColor

Gets or sets default selected item background color.

DefaultSelectedItemTextColor

Gets or sets default selected item text color.

Properties

AnchorIndex

Gets or sets anchor item index.

AreSelectEventsSuspended

Gets whether SelectionChanged (and other events which are raised on selection change) are suspended.

CheckBoxAllowAllStatesForUser

Gets or sets whether user can set the checkboxes to the third state by clicking.

CheckBoxThreeState

Gets or sets a value indicating whether checkbox will allow three check states rather than two.

CheckBoxVisible

Gets or sets whether to show checkboxes in the items.

CheckOnClick

Gets or sets a value indicating whether the checkbox should be toggled when an item is clicked on the checkbox area.

CheckedCount

Gets number of checked items.

CheckedIndex

Gets or sets the zero-based index of the currently checked item in a ListBox.

CheckedIndices

Gets a collection that contains the zero-based indexes of all currently checked items in the control.

CheckedIndicesDescending

Gets a collection that contains the zero-based indexes of all currently checked items in the control.

ControlKind

Returns control identifier.

CurrentItemBorder

Gets or sets current item border. If it is null (default value), DefaultCurrentItemBorder is used.

CurrentItemBorderVisible

Gets or sets whether current item border is visible.

DefaultCurrentItemBorder

Gets or sets default border of the listbox's current item.

DelayedSelectionChangedInterval

Gets or sets default timeout interval (in msec) for timer that calls DelayedSelectionChanged event. If not specified, DefaultDelayedTextChangedTimeout is used.

DisabledItemTextColor

Gets or sets disabled item text color.

IsSelectionModeMultiple

Gets or sets whether selection mode is Multiple

IsSelectionModeSingle

Gets or sets whether selection mode is Single

ItemAlignment

Gets or sets default alignment of the items.

ItemMargin

Gets or sets item margin.

ItemPainter

Gets or sets item painter associated with the control.

ItemTextColor

Gets or sets item text color.

MinItemHeight

Gets minimal height of the items. Default is DefaultMinItemHeight.

SelectedIndex

Gets or sets the zero-based index of the currently selected item in the control.

SelectedIndexes

Same as SelectedIndices.

SelectedIndices

Gets a collection that contains the zero-based indexes of all currently selected items in the control.

SelectedIndicesDescending

Gets a collection that contains the zero-based indexes of all currently selected items in the control.

SelectedItem

Gets or sets the currently selected item in the control.

SelectedItemBackColor

Gets or sets selected item back color.

SelectedItemIsBold

Gets or sets whether SelectedItem has bold font.

SelectedItemTag

Gets 'Tag' property of the selected item if it is BaseObjectWithAttr.

SelectedItemTextColor

Gets or sets selected item text color.

SelectedItems

Gets a collection containing the currently selected items in the control.

SelectedItemsArray

Gets selected items as array.

SelectionBorder

Gets or sets selection border.

SelectionMode

Gets or sets the method in which items are selected in the control.

SelectionUnderImage

Gets or sets whether to draw selection background under image.

SelectionVisible

Gets or sets whether selection background is visible.

SvgImageSize

Gets or sets default size of the svg images.

TextVisible

Gets or sets whether item text is displayed.

Methods

AddItemsThreadSafe<TSource>(IEnumerable<TSource>, Func<TSource, ListControlItem?>, Func<bool>, int, int)

Allows to set items from the IEnumerable<T> with huge number of items which is "yield" constructed. This method can be called from the another thread which is different from UI thread.

CanRemoveSelectedItem()

Gets whether selected item can be removed.

CheckItems(params int[])

Checks items with specified indexes.

ClearChecked()

Unchecks all items in the control.

ClearChecked(bool)

Unchecks all items in the control and optionally calls RaiseCheckedChanged(EventArgs).

ClearSelected()

Unselects all items in the control.

ClearSelectedExcept(int?)

Clears selected items except the item with the specified index.

DefaultDrawItemBackground(ListBoxItemPaintEventArgs)

Draws default background for the item with the specified index. Used inside DrawItemBackground(ListBoxItemPaintEventArgs).

DefaultDrawItemForeground(ListBoxItemPaintEventArgs)

Default method which draws items. Called from DrawItemForeground(ListBoxItemPaintEventArgs).

DoInsideSuspendedSelectionEvents(Action)

Calls the specified action inside the block with suspended selection events.

DrawItemBackground(ListBoxItemPaintEventArgs)

Draws background for the item with the specified index. If ItemPainter is assigned, uses PaintBackground(object, ListBoxItemPaintEventArgs), otherwise calls DefaultDrawItemBackground(ListBoxItemPaintEventArgs).

DrawItemForeground(ListBoxItemPaintEventArgs)

Draws item with the specified index. If ItemPainter is assigned, uses Paint(object, ListBoxItemPaintEventArgs), otherwise calls DefaultDrawItemForeground(ListBoxItemPaintEventArgs).

EnsureVisible(int)

Makes item with the specified index visible in the control's view.

GetDisabledItemTextColor(int)

Gets disabled item text color.

GetFirstSelectedIndex()

Gets index of the first selected item.

GetItemAlignment(int)

Gets item alignment.

GetItemAsObject(int)

Gets item as object.

GetItemCheckBoxAllowAllStatesForUser(ListControlItem)

Gets whether user can set the checkbox of the item to the third state by clicking.

GetItemFont(int)

Gets item font. It must not be null.

GetItemImages(int, Color?)

Gets item image.

GetItemMinHeight(int)

Gets item minimal height.

GetItemShowCheckBox(ListControlItem)

Gets whether checkbox is shown in the item.

GetItemTextColor(int)

Gets item text color. Default is ItemTextColor (if it is not null) or DefaultItemTextColor.

GetLastSelectedIndexInBlock()

Gets index of the last selected item in the block.

GetSelectedItemBackColor(int)

Gets selected item back color. Default is SelectedItemBackColor (if it is not null) or DefaultSelectedItemBackColor.

GetSelectedItemTextColor(int)

Gets selected item text color. Default is SelectedItemTextColor (if it is not null) or DefaultSelectedItemTextColor.

GetValidIndexes(params int[])

Gets only valid indexes from the list of indexes in the control.

HasItems()

Gets whether control has items.

HasSelectedItems()

Gets whether control has selected items.

HitTest(PointD)

Returns the zero-based index of the item at the specified coordinates.

IsCurrent(int)

Gets whether item with the specified index is current.

IsSelected(int)

Gets whether item with the specified index is selected.

IsValidIndex(int)

Checks whether index is valid in the control.

OnCheckedChanged(EventArgs)

Called when when the checkbox state of the item has changed.

OnMouseDoubleClick(MouseEventArgs)

Called when the mouse button was double-clicked.

OnSelectedIndexChanged(EventArgs)

Called when the SelectedIndex property or the SelectedIndices collection has changed.

OnSelectionChanged(EventArgs)

Called when the SelectedIndex property or the SelectedIndices collection has changed.

RaiseCheckedChanged(EventArgs)

Raises the CheckedChanged event and calls OnCheckedChanged(EventArgs).

RaiseSelectionChanged(EventArgs?)

Raises the SelectionChanged event and calls OnSelectionChanged(EventArgs).

RaiseSelectionModeChanged()

Raises SelectionModeChanged event.

RemoveCheckedItems()

Removes checked items from the control.

RemoveSelectedItem()

Removes selected item from the control.

RemoveSelectedItems()

Removes selected items from the control.

ResumeSelectionEvents()

Resumes raising of SelectionChanged and other events which are raised on selection change.

RunSelectedItemDoubleClickAction()

Runs action specified in the DoubleClickAction property of the selected item.

SelectAll()

Selects all items in the control.

SelectItems(params int[])

Selects items with specified indexes in the control.

SelectRange(int, int, bool)

Selects or unselects range of the items (inclusive).

SelectedItemsAsText(string?)

Gets selected items as string.

SelectedItemsToClipboard(string?)

Copies result of the SelectedItemsAsText(string?) to clipboard.

SetAllSelected(bool)

Changes selected state for all items in the control.

SetChecked(int, bool)

Checks or clears the check state for the specified item in a CheckListBox.

SetColorThemeToDark()

Sets colors used in the control to the dark theme.

SetColorThemeToDefault()

Sets colors used in the control to the default theme.

SetItemCheckState(int, CheckState)

Changes the check state for the specified item.

SetItemCheckStateCore(int, CheckState)

Changes the check state for the specified item.

SetItemChecked(int, bool)

Checks or clears the check state for the specified item.

SetItemCheckedCore(int, bool)

Checks or clears the check state for the specified item.

SetItemsFast<TItemFrom>(IEnumerable<TItemFrom>, Action<ListControlItem, TItemFrom>, Func<ListControlItem>)

Sets items from the specified collection to the control's items as fast as possible.

SetSelected(int, bool)

Selects or clears the selection for the specified item in a control.

SetSelectedCore(int, bool)

Changes selected state of the item without raising events.

SetSelectedIndex(int?, bool, bool)

Changes SelectedIndex property value and optionally clears previous selection.

SuspendSelectionEvents()

Suspend raising of SelectionChanged and other events which are raised on selection change.

UnselectAll()

Unselects all items in the control.

Events

CheckedChanged

Occurs when the checked state of an item changes.

DelayedSelectionChanged

Occurs when the SelectedIndex, SelectedItem or the SelectedIndices have changed.

SelectedIndexChanged

Occurs when the SelectedIndex property has changed. Same as SelectionChanged, see it for the details.

SelectionChanged

Occurs when the SelectedIndex property or the SelectedIndices collection has changed.

SelectionModeChanged

Occurs when the value of the SelectionMode property changes.