Table of Contents

Class HintTextBox

Namespace
NanoByte.Common.Controls
Assembly
NanoByte.Common.WinForms.dll

A special System.Windows.Forms.TextBox that displays a HintText when System.Windows.Forms.TextBox.Text is empty and a clear button when it is not.

public class HintTextBox : TextBox
Inheritance
object
MarshalByRefObject
Component
Control
TextBoxBase
TextBox
HintTextBox
Derived
Extension Methods

Constructors

HintTextBox()

public HintTextBox()

Properties

ForeColor

Gets or sets the color used when displaying text in the control.

public Color ForeColor { get; set; }

Property Value

Color

HintText

A text to be displayed in System.Drawing.SystemColors.GrayText when System.Windows.Forms.TextBox.Text is empty.

public string HintText { get; set; }

Property Value

string

IsHintTextVisible

Indicates whether the HintText is currently visible.

[Browsable(false)]
public bool IsHintTextVisible { get; }

Property Value

bool

ShowClearButton

Controls whether the clear button is shown. Remains invisible when the HintText is visible.

public bool ShowClearButton { get; set; }

Property Value

bool

Text

Gets or sets the text associated with this control.

public override string Text { get; set; }

Property Value

string

The text associated with this control.

Methods

OnBackColorChanged(EventArgs)

Raises the System.Windows.Forms.Control.BackColorChanged event.

protected override void OnBackColorChanged(EventArgs e)

Parameters

e EventArgs

An System.EventArgs that contains the event data.

OnClearButtonClicked(EventArgs)

Raises the ClearButtonClicked event.

protected virtual void OnClearButtonClicked(EventArgs e)

Parameters

e EventArgs

OnEnter(EventArgs)

Raises the System.Windows.Forms.Control.Enter event.

protected override void OnEnter(EventArgs e)

Parameters

e EventArgs

An System.EventArgs that contains the event data.

OnLeave(EventArgs)

Raises the System.Windows.Forms.Control.Leave event.

protected override void OnLeave(EventArgs e)

Parameters

e EventArgs

An System.EventArgs that contains the event data.

OnTextChanged(EventArgs)

Raises the System.Windows.Forms.Control.TextChanged event.

protected override void OnTextChanged(EventArgs e)

Parameters

e EventArgs

An System.EventArgs that contains the event data.

Events

ClearButtonClicked

Occurs when the clear button is clicked.

public event EventHandler? ClearButtonClicked

Event Type

EventHandler