ColorListBox Class
public class ColorListBox : ListBox, IDisposable, IDpiAwareElement
- Inheritance:
- object MarshalByRefObject Component Control ListControl ListBox object
- Implements:
- IDisposable IDpiAwareElement
Constructors
ColorListBox()
Initializes a new instance of the ColorListBox
class.
public ColorListBox()
Remarks
The default constructor initializes all fields to their default values.
Properties
ColorSet
Gets the ColorListBoxColorSet that indicates the color set that is loaded.
public ColorListBoxColorSet ColorSet { get; set; }
Property Value
- ColorListBoxColorSet:
The ColorListBoxColorSet that indicates the color set that is loaded.
DrawMode
Gets or sets the drawing mode for the control.
[Browsable(false)]
public DrawMode DrawMode { get; set; }
Property Value
- DrawMode:
One of the DrawMode values representing the mode for drawing the items of the control. The default is
DrawMode.Normal
.
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | The value assigned to the property is not a member of the DrawMode enumeration. |
ArgumentException | A multicolumn ListBox cannot have a variable-sized height. |
ItemHeight
Gets the height of an item in the ColorListBox.
[Browsable(false)]
public int ItemHeight { get; set; }
Property Value
- int:
The height, in pixels, of an item in the control.
Remarks
The height of items in this control is automatically determined based on current device DPI. Setting this value will have no effect.
SelectedColor
Gets or sets the selected color in the list.
[Browsable(false)]
public Color SelectedColor { get; set; }
Property Value
Methods
InitializeColors(Color[])
Initializes the list using the specified array of Color objects.
public void InitializeColors(Color[] colors)
Parameter | Type | Description |
---|---|---|
colors | Color[] | An array of Color objects with which to initialize the list. |
OnDrawItem(DrawItemEventArgs)
Occurs when an item needs to be drawn.
protected override void OnDrawItem(DrawItemEventArgs e)
Parameter | Type | Description |
---|---|---|
e | DrawItemEventArgs | A |
OnFontChanged(EventArgs)
Occurs when then font property is changed.
protected override void OnFontChanged(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
OnMeasureItem(MeasureItemEventArgs)
Occurs when an item needs to be measured.
protected override void OnMeasureItem(MeasureItemEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MeasureItemEventArgs | A |
WndProc(ref Message)
Occurs when a message is sent to the control.
protected override void WndProc(ref Message m)
Parameter | Type | Description |
---|---|---|
m | Message | Information about the message. |
Inherited Members
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()
Extension Methods
- DpiAwareElementExtensions.AutoScaleFont(IDpiAwareElement, Font)
- DpiAwareElementExtensions.AutoScaleFontSize(IDpiAwareElement, float)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Padding)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Point)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Rectangle)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Size)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, SizeF)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, int)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, float)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Padding)
- DpiAwareElementExtensions.SynchronizeScaleFactorWithChildren(IDpiAwareElement)
- ControlExtensions.FindAncestorOrSelf<T>(Control)
- ControlExtensions.FindAncestorOrSelf<T>(Control, Predicate<T>)
- ControlExtensions.FindAncestor<T>(Control)
- ControlExtensions.FindAncestor<T>(Control, Predicate<T>)