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

public override string Text { get; set; }

Property Value

string

Methods

OnBackColorChanged(EventArgs)

protected override void OnBackColorChanged(EventArgs e)

Parameters

e EventArgs

OnClearButtonClicked(EventArgs)

Raises the ClearButtonClicked event.

protected virtual void OnClearButtonClicked(EventArgs e)

Parameters

e EventArgs

OnEnter(EventArgs)

protected override void OnEnter(EventArgs e)

Parameters

e EventArgs

OnLeave(EventArgs)

protected override void OnLeave(EventArgs e)

Parameters

e EventArgs

OnTextChanged(EventArgs)

protected override void OnTextChanged(EventArgs e)

Parameters

e EventArgs

Events

ClearButtonClicked

Occurs when the clear button is clicked.

public event EventHandler? ClearButtonClicked

Event Type

EventHandler