Table of Contents

Class HintTextBox

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

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

public class HintTextBox : TextBox, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
Inheritance
object
MarshalByRefObject
HintTextBox
Implements
Derived
Inherited Members
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 GrayText when 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 BackColorChanged event.

protected override void OnBackColorChanged(EventArgs e)

Parameters

e EventArgs

An 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 Enter event.

protected override void OnEnter(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.

OnTextChanged(EventArgs)

Raises the TextChanged event.

protected override void OnTextChanged(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

Events

ClearButtonClicked

Occurs when the clear button is clicked.

public event EventHandler? ClearButtonClicked

Event Type

EventHandler