Table of Contents

Class ExRichTextBox

Namespace
ExControls
Assembly
ExControls.dll

Extended RichTextBox 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.

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

Constructors

ExRichTextBox()

Initializes a new instance of the ExRichTextBox class.

public ExRichTextBox()

Properties

BorderColor

Color of the RichTextBox's border

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

Property Value

Color

BorderStyle

Gets or sets the border style of the rich text box in the default style. When DefaultStyle is false, the native border is None, because the control draws its own border; the value is kept and used again when DefaultStyle is turned back on.

public BorderStyle BorderStyle { get; set; }

Property Value

BorderStyle

BorderThickness

Width of the RichTextBox'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 RichTextBox 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 RichTextBox'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 RichTextBox 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

Methods

ApplyTheme(ExTheme)

Switches the box to the custom style and sets its colors by the theme. A box designed in the custom style keeps it also in the system style, a box without a border in the design stays in the default style (with the theme colors), so that it doesn't get a border.

public void ApplyTheme(ExTheme theme)

Parameters

theme ExTheme

theme to apply

OnDefaultStyleChanged()

Raises the DefaultStyleChanged event.

protected virtual void OnDefaultStyleChanged()

OnEnter(EventArgs)

Raises the Enter event.

protected override void OnEnter(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnGotFocus(EventArgs)

protected override void OnGotFocus(EventArgs e)

Parameters

e EventArgs

OnHScroll(EventArgs)

Raises the HScroll event.

protected override void OnHScroll(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains 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.

OnVScroll(EventArgs)

Raises the VScroll event.

protected override void OnVScroll(EventArgs e)

Parameters

e EventArgs

An EventArgs 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 changed.

public event EventHandler? DefaultStyleChanged

Event Type

EventHandler