Table of Contents

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

Color

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

int

DefaultStyle

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Default style of the Control.")]
public bool DefaultStyle { get; set; }

Property Value

bool

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

Color

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

Color

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

Color

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

DrawMode

SelectedRowBackColor

Color of the selected row.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the selected row.")]
public Color SelectedRowBackColor { get; set; }

Property Value

Color

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

Color

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

theme ExTheme

theme to apply

OnCreateControl()

Raises the CreateControl() method.

protected override void OnCreateControl()

OnDrawItem(DrawItemEventArgs)

Raises the DrawItem event.

protected override void OnDrawItem(DrawItemEventArgs e)

Parameters

e DrawItemEventArgs

A DrawItemEventArgs that contains the event data.

OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.

protected override void OnEnabledChanged(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

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

m Message

A 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

EventHandler

SelectedRowForeColorChanged

Occurs when the SelectedRowForeColor property changes.

[ExCategory("Changed Property")]
[ExDescription("Occurs when the SelectedRowForeColor property changes.", true)]
public event EventHandler? SelectedRowForeColorChanged

Event Type

EventHandler