Class ExListBox
- Namespace
- ExControls
- Assembly
- ExControls.dll
Extended ListBox control: in the custom style it draws the border with its own color and thickness, the selected rows in their own background and text colors and a disabled list in its own colors.
[ToolboxBitmap(typeof(ToolboxIcons), "Toolbox.ExListBox.ico")]
public class ExListBox : ListBox, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IThemeable
- Inheritance
-
ExListBox
- Implements
- Inherited Members
- Extension Methods
Constructors
ExListBox()
Initializes a new instance of the ExListBox class in the default style.
public ExListBox()
Properties
BorderColor
Color of the ListBox's border.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the ListBox's border.")]
public Color BorderColor { get; set; }
Property Value
BorderThickness
Width of the ListBox's border.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Width of the ListBox's border.")]
public int BorderThickness { get; set; }
Property Value
DefaultStyle
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Default style of the Control.")]
public bool DefaultStyle { get; set; }
Property Value
DisabledBackColor
Background color of the ListBox when it is disabled.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Background color of the ListBox's when it is disabled.")]
public Color DisabledBackColor { get; set; }
Property Value
DisabledBorderColor
Color of the ListBox's border when it is disabled.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the ListBox's border when it is disabled.")]
public Color DisabledBorderColor { get; set; }
Property Value
DisabledForeColor
Foreground color of the ListBox when it is disabled
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Foreground color of the ListBox's when it is disabled.")]
public Color DisabledForeColor { get; set; }
Property Value
DrawMode
Gets or sets how the items are drawn in the default style; the custom style always draws them itself (OwnerDrawFixed).
public override DrawMode DrawMode { get; set; }
Property Value
SelectedRowBackColor
Color of the selected row.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the selected row.")]
public Color SelectedRowBackColor { get; set; }
Property Value
SelectedRowForeColor
Text color of the selected rows; with a light SelectedRowBackColor it has to be dark.
[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Text color of the selected rows.")]
public Color SelectedRowForeColor { get; set; }
Property Value
Methods
ApplyTheme(ExTheme)
Switches the list to the custom style and sets its colors by the theme (the box colors also in the system style). A list designed in the custom style keeps it also in the system style. In the custom style a list with a border gets a 1 px border, a list without a border stays without one.
public void ApplyTheme(ExTheme theme)
Parameters
themeExThemetheme to apply
OnCreateControl()
Raises the CreateControl() method.
protected override void OnCreateControl()
OnDrawItem(DrawItemEventArgs)
Raises the DrawItem event.
protected override void OnDrawItem(DrawItemEventArgs e)
Parameters
eDrawItemEventArgsA DrawItemEventArgs that contains the event data.
OnEnabledChanged(EventArgs)
Raises the EnabledChanged event.
protected override void OnEnabledChanged(EventArgs e)
Parameters
OnSelectedRowBackColorChanged()
Raises the SelectedRowBackColorChanged event.
protected virtual void OnSelectedRowBackColorChanged()
OnSelectedRowForeColorChanged()
Raises the SelectedRowForeColorChanged event.
protected virtual void OnSelectedRowForeColorChanged()
WndProc(ref Message)
The list's window procedure.
protected override void WndProc(ref Message m)
Parameters
mMessageA Windows Message Object.
Events
SelectedRowBackColorChanged
Occurs when the SelectedRowBackColor property changes.
[ExCategory("Changed Property")]
[ExDescription("Occurs when the SelectedRowBackColor property changes.", true)]
public event EventHandler? SelectedRowBackColorChanged
Event Type
SelectedRowForeColorChanged
Occurs when the SelectedRowForeColor property changes.
[ExCategory("Changed Property")]
[ExDescription("Occurs when the SelectedRowForeColor property changes.", true)]
public event EventHandler? SelectedRowForeColorChanged