Class ListControlItem
Custom item for ListBox, 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
- 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.
- 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.
- LabelFlags
Gets or sets draw label flags.
- MinHeight
Gets or sets minimal item height.
- SelectedImage
Gets or sets Image associated with the item when it is selected.
- 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
- Assign(ListControlItem)
Copies the properties of the specified ListControlItem instance to the current instance. This method may not copy all the properties.
- CalcForegroundMetrics(IListControlItemContainer?, ListBoxItemPaintEventArgs)
Default method which calls DefaultDrawForeground(IListControlItemContainer?, ListBoxItemPaintEventArgs) for the LabelMetrics calculation.
- Clone()
Creates a copy of this object.
- 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.
- 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?)
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.
- GetMinHeight(ListControlItem?, IListControlItemContainer?)
Gets item minimal height.
- 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.
- SetImage(VisualControlState, Image?, bool?)
Sets image for the specified color theme light/dark theme flag.
- 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.