Table of Contents

Class ExTextBox

Namespace
ExControls
Assembly
ExControls.dll

Extended TextBox control: in the custom style it draws the border with its own color and thickness, highlighted when the control has focus or is under the mouse, and uses its own colors when disabled; it can show a hint text and dark scroll bars.

[ToolboxBitmap(typeof(ToolboxIcons), "Toolbox.ExTextBox.ico")]
public class ExTextBox : TextBox, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IExControl, IThemeable
Inheritance
ExTextBox
Implements
Inherited Members
Extension Methods

Constructors

ExTextBox()

Initializes a new instance of the ExTextBox class in the default style.

public ExTextBox()

Properties

BorderColor

Color of the TextBox's border.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the TextBox's border.")]
public Color BorderColor { get; set; }

Property Value

Color

BorderThickness

Width of the TextBox's border.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Width of the TextBox's border.")]
public int BorderThickness { get; set; }

Property Value

int

DefaultStyle

Gets or sets whether the control uses the default Windows style; false = the custom style drawn by the control with its own colors.

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

Property Value

bool

DisabledBackColor

Background color of the TextBox when it is disabled.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Background color of the TextBox's when it is disabled.")]
public Color DisabledBackColor { get; set; }

Property Value

Color

DisabledBorderColor

Color of the TextBox's border when it is disabled.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the TextBox's border when it is disabled.")]
public Color DisabledBorderColor { get; set; }

Property Value

Color

DisabledForeColor

Foreground color of the TextBox when it is disabled.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Foreground color of the TextBox's when it is disabled.")]
public Color DisabledForeColor { get; set; }

Property Value

Color

HighlightColor

Color of the border of TextBox when mouse is over the Control.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Color of the border of TextBox when mouse is over the Control.")]
public Color HighlightColor { get; set; }

Property Value

Color

HintForeColor

TextBox hint foreground color.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("TextBox hint foreground color.")]
public Color HintForeColor { get; set; }

Property Value

Color

HintText

Hint text for TextBox.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Hint text for TextBox.")]
public string? HintText { get; set; }

Property Value

string

UseDarkScrollBar

Use dark (DarkMode_Explorer) scroll bars for the multiline TextBox.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Use dark (DarkMode_Explorer) scroll bars.")]
public bool UseDarkScrollBar { get; set; }

Property Value

bool

Methods

ApplyTheme(ExTheme)

Sets the colors and appearance of the control by the theme.

public void ApplyTheme(ExTheme theme)

Parameters

theme ExTheme

DrawHint(Graphics)

Draws the hint text when the text box is empty and does not have focus.

protected virtual void DrawHint(Graphics g)

Parameters

g Graphics

The graphics to draw on.

OnCreateControl()

Raises the CreateControl() method.

protected override void OnCreateControl()

OnDefaultStyleChanged()

Raises the DefaultStyleChanged event.

protected virtual void OnDefaultStyleChanged()

OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.

protected override void OnEnabledChanged(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnEnter(EventArgs)

Raises the Enter event.

protected override void OnEnter(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnGotFocus(EventArgs)

Raises the GotFocus event.

protected override void OnGotFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnHandleCreated(EventArgs)

Raises the HandleCreated event.

protected override void OnHandleCreated(EventArgs e)

Parameters

e EventArgs

The event data.

OnLeave(EventArgs)

Raises the Leave event.

protected override void OnLeave(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnLostFocus(EventArgs)

Raises the LostFocus event.

protected override void OnLostFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseEnter(EventArgs)

Raises the MouseEnter event.

protected override void OnMouseEnter(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseLeave(EventArgs)

Raises the MouseLeave event.

protected override void OnMouseLeave(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnPaint(PaintEventArgs)

Raises the Paint event.

protected override void OnPaint(PaintEventArgs e)

Parameters

e PaintEventArgs

A PaintEventArgs that contains the event data.

WndProc(ref Message)

Processes Windows messages.

protected override void WndProc(ref Message m)

Parameters

m Message

A Windows Message object.

Events

DefaultStyleChanged

Occurs when the DefaultStyle property changes.

[ExCategory("Changed Property")]
[ExDescription("Occurs when the BorderColor property changes.")]
public event EventHandler? DefaultStyleChanged

Event Type

EventHandler