Class ListControlItem
Custom item for StdListBox, ComboBox and other list controls. This class has Text, Value and other properties which allow to customize look of the item.
public class ListControlItem : BaseControlItem, IBaseObjectWithAttr, IBaseObjectWithId, IBaseObject, INotifyPropertyChanged, IComparable<ListControlItem>
- Inheritance
-
ListControlItem
- Implements
- Derived
Constructors
- ListControlItem()
Initializes a new instance of the ListControlItem class.
- ListControlItem(string)
Initializes a new instance of the ListControlItem class with the default value for the Text property.
- ListControlItem(string, Action?)
Initializes a new instance of the ListControlItem class with the default value for the Text property and an action associated with the item.
- ListControlItem(string, object?)
Initializes a new instance of the ListControlItem class with the default values for the Text and Value properties.
Fields
- AllowDifferentSizeForDisabledImage
Indicates whether images with different sizes are allowed for disabled and selected states. Default is false.
- CheckBoxSizeOverride
Gets or sets the size of the checkbox override. Default is Null. It is used when checkbox size is determined if specified.
- DefaultItemAlignment
Gets default item alignment.
- DrawDebugCornersOnElements
Gets or sets whether to draw debug corners around item elements (image, text, etc.).
- NullContainerId
Gets id of the null container.
Properties
- Action
Gets or sets Action associated with this ListControlItem instance.
- Alignment
Gets or sets alignment of the item.
- BackgroundColor
Gets or sets background color of the item.
- Border
Gets or sets border of the item.
- CanRemove
Gets or sets whether item can be removed.
- CheckBoxAllowAllStatesForUser
Gets or sets whether user can set the checkbox to the third state by clicking. If property is null (default), control's setting is used.
- CheckBoxThreeState
Gets or sets a value indicating whether checkbox will allow three check states rather than two. If property is null (default), control's setting is used.
- CheckBoxVisible
Gets or sets whether to show check box inside the item. This property (if specified) overrides global checkboxes visibility setting in the control.
- CheckState
Gets or sets state of the check box associated with the item.
- DisabledImage
Gets or sets disabled Image associated with the item.
- DisplayText
Gets or sets text for the display purposes.
- DoubleClickAction
Gets or sets Action which is executed on mouse double click.
- DrawBackgroundAction
Gets or sets an action which is called when background is painted for the item. When this action is specified, default background painting is not performed.
- DrawForegroundAction
Gets or sets an action which is called when foreground is painted for the item. When this action is specified, default foreground painting is not performed.
- ForegroundColor
Gets or sets foreground color of the item.
- ForegroundMargin
Gets or sets margin of the item when foreground is painted.
- ForegroundMarginLeft
Gets or sets left margin of the item when foreground is painted.
- Group
Gets or sets group id of the item.
- HasValidImageIndex
Gets a value indicating whether the item has a valid image index assigned.
- HideFocusRect
Gets or sets whether to hide focus rectangle for this item.
- HideSelection
Gets or sets whether to hide selection for this item.
- HorizontalAlignment
Gets or sets horizontal alignment of the item.
- ImageIndex
Gets or sets image index used when item is painted.
- IsBold
Gets or sets a value indicating whether the font style of the item is bold. This property is based on the FontStyle value.
- IsChecked
Gets or sets a value indicating whether the item is checked. Uses CheckState internally.
- IsRadioButton
Gets or sets whether to paint check box as radio button.
- LabelFlags
Gets or sets draw label flags.
- MinHeight
Gets or sets minimal item height.
- PrefixElements
Gets or sets array of elements to draw before the label text and image.
- SelectedImage
Gets or sets Image associated with the item when it is selected. Setter of this property sets both light and dark images.
- SuffixElements
Gets or sets array of elements to draw after the label text and image.
- SvgImageHeight
Gets or sets height of the svg image.
- SvgImageSize
Gets or sets size of the svg image.
- SvgImageWidth
Gets or sets width of the svg image.
- Text
Gets or sets text which is displayed when item is painted.
- TextHasBold
Gets or sets whether text may contain html bold tags.
- TextLineAlignment
Gets or sets horizontal alignment of the text line within text block.
- TextLineDistance
Gets or sets distance between lines of the text.
- VerticalAlignment
Gets or sets vertical alignment of the item.
Methods
- AddRangeOfValues(BaseCollection<ListControlItem>?, IEnumerable?)
Adds a range of values to the specified collection of items. For each value, a new ListControlItem is created and added to the collection.
- Assign(ListControlItem)
Copies the properties of the specified ListControlItem instance to the current instance. This method may not copy all the properties. Properties that are not copied include those that are Action delegates, Graphics.DrawElementParams arrays, and any other complex objects.
- CalcForegroundMetrics(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Default method which calls DefaultDrawForeground(IListControlItemContainer?, ListBoxItemPaintEventArgs) for the LabelMetrics calculation.
- Clone()
Creates a copy of this object.
- Compare(ListControlItem?, ListControlItem?)
Compares two ListControlItem objects and returns a value indicating their relative order.
- CompareTo(ListControlItem?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
- DefaultDebugDrawForeground(IListControlItemContainer?, ListBoxItemPaintEventArgs, DrawLabelParams)
Draws debug information for a list control item during the foreground painting phase in debug mode.
- DefaultDrawBackground(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Draws default background for the item.
- DefaultDrawCheckBox(Graphics, AbstractControl, ItemCheckBoxInfo)
Draws the default checkbox for the item.
- DefaultDrawForeground(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Default method which draws item foreground.
- DefaultMeasureItemSize(IListControlItemContainer, Graphics, int)
Default method which measures item size.
- DrawBackground(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Draws item background;
- DrawForeground(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Draws item foreground.
- FindItemIndexWithValue(IList<ListControlItem>, object?)
Finds the index of the item with Value property which is equal to the specified value.
- GetAdditionalImageMargin()
Gets an additional image margin.
- GetAdditionalTextMargin()
Gets an additional text margin.
- GetAlignment(ListControlItem?, IListControlItemContainer?)
Gets item alignment.
- GetAllowThreeState(IListControlItemContainer?)
Gets whether three state checkbox is allowed in the item.
- GetCheckBoxInfo(IListControlItemContainer?, RectD)
Retrieves information about the checkbox associated with the item, including its visibility, state, size, and position.
- GetCheckBoxSize(IListControlItemContainer?, CheckState?, VisualControlState?)
Gets the size of the checkbox.
- GetCheckState(IListControlItemContainer?)
Gets CheckState of the item using GetAllowThreeState(IListControlItemContainer?) and CheckState.
- GetContainerFont(IListControlItemContainer?)
Gets font of the container.
- GetContainerForegroundColor(IListControlItemContainer?)
Gets foreground color of the container.
- GetContainerRelated(IListControlItemContainer?)
Retrieves an item containing data related to the specified container. If the container is null, a default container-related data object is returned.
- GetDisabledTextColor(ListControlItem?, IListControlItemContainer?)
Gets disabled item text color.
- GetFont(IListControlItemContainer?)
Gets font used when item is painted. Result is not
null.
- GetFont(ListControlItem?, IListControlItemContainer?, bool)
Gets font when item is inside the specified container. Result must not be
null.
- GetImage(VisualControlState, bool?)
Gets image for the specified item state and light/dark theme flag.
- GetItemImageRect(RectD, SizeD?)
Gets suggested rectangles of the item's image and text.
- GetItemTextColor(ListControlItem?, IListControlItemContainer?)
Gets item text color when item is inside the container.
- GetMembersOfGroup(IEnumerable<ListControlItem>, ObjectUniqueId?)
Gets the members of a specific group within the collection. Uses the Group property to filter items.
- GetMinHeight(ListControlItem?, IListControlItemContainer?)
Gets item minimal height.
- GetOtherMembersOfGroup(IEnumerable<ListControlItem>, ObjectUniqueId?, ListControlItem)
Gets the members of a specific group within the collection except the specified item. Uses the Group property to filter items.
- GetSelectedItemBackColor(ListControlItem?, IListControlItemContainer?)
Gets selected item back color.
- GetSelectedTextColor(ListControlItem?, IListControlItemContainer?)
Gets selected item text color when item is inside the container.
- GetShowCheckBox(IListControlItemContainer?)
Gets whether checkbox is shown in the item.
- GetTextColor(IListControlItemContainer?)
Gets item text color when item is inside the container.
- HasImage(VisualControlState, bool?)
Gets whether item has image for the specified item state and light/dark theme flag.
- IsContainerDark(IListControlItemContainer?)
Gets whether container is using dark color theme.
- IsContainerEnabled(IListControlItemContainer?)
Gets whether container is enabled.
- IsSelected(IListControlItemContainer?)
Gets whether item is selected.
- ResetCachedImages()
Clears all cached images, forcing them to be reloaded on the next access.
- SetImage(VisualControlState, Image?, bool?)
Sets image for the specified color theme light/dark theme flag.
- SetImageLightDark(VisualControlState, Image?)
Sets the specified image for both light and dark themes in the given visual control state.
- SetLabelFlag(DrawLabelFlags, bool)
Turns on or off LabelFlags element(s).
- SetSelected(IListControlItemContainer?, bool)
Sets whether item is selected.
- SetValue(object?)
Sets Value property.
- ToString()
Returns a string that represents the current object.
- ToggleSelected(IListControlItemContainer?)
Toggles selected state of the item.
- UncheckOtherItemsInGroup(IEnumerable<ListControlItem>, ListControlItem)
Unchecks all items in the specified collection that belong to the same group which is defined by the Group property.
itemis used to determine the group and is not unchecked.