Class
RadWatermarkTextBox

Represents a customizable TextBox control that displays watermark text and allows for additional label functionality. The RadWatermarkTextBox includes properties for defining and styling a label, managing the visibility of watermark content based on the focused state, and provides dependency properties for maintaining text, selection behavior, and additional content. It features animations for label transitions and supports themes for visual customization. This control is designed to enhance user experience by providing contextual information and interaction cues when input fields are empty or untitled.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Input")]
public class RadWatermarkTextBox : TextBox

Inheritance: objectRadWatermarkTextBox

Derived Classes: RadPasswordBox

Constructors

RadWatermarkTextBox()

Initializes a new instance of the RadWatermarkTextBox class.

Declaration

cs-api-definition
public RadWatermarkTextBox()

Fields

AdditionalContentProperty

Identifies the AdditionalContent property.

Declaration

cs-api-definition
public static readonly DependencyProperty AdditionalContentProperty

Field Value

DependencyProperty

AdditionalContentTemplateProperty

Identifies the AdditionalContentTemplate property.

Declaration

cs-api-definition
public static readonly DependencyProperty AdditionalContentTemplateProperty

Field Value

DependencyProperty

CurrentTextProperty

Identifies the CurrentText dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CurrentTextProperty

Field Value

DependencyProperty

DisabledBackgroundProperty

Identifies the DisabledBackground property.

Declaration

cs-api-definition
public static readonly DependencyProperty DisabledBackgroundProperty

Field Value

DependencyProperty

HasLabelProperty

Identifies the HasLabel dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HasLabelProperty

Field Value

DependencyProperty

IsLabelFloatedProperty

Identifies the IsLabelFloated dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsLabelFloatedProperty

Field Value

DependencyProperty

IsWatermarkVisibleProperty

Identifies the IsWatermarkVisible dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsWatermarkVisibleProperty

Field Value

DependencyProperty

KeepLabelFloatedProperty

Identifies the KeepLabelFloated dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty KeepLabelFloatedProperty

Field Value

DependencyProperty

LabelProperty

Identifies the Label dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelProperty

Field Value

DependencyProperty

LabelStyleProperty

Identifies the LabelStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelStyleProperty

Field Value

DependencyProperty

ReadOnlyBackgroundProperty

Identifies the ReadOnlyBackground property.

Declaration

cs-api-definition
public static readonly DependencyProperty ReadOnlyBackgroundProperty

Field Value

DependencyProperty

SelectionOnFocusProperty

Identifies the SelectionOnFocus property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectionOnFocusProperty

Field Value

DependencyProperty

WatermarkBehaviorProperty

Identifies the WatermarkBehavior property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkBehaviorProperty

Field Value

DependencyProperty

WatermarkContentProperty

Identifies the WatermarkContent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkContentProperty

Field Value

DependencyProperty

WatermarkTemplateProperty

Identifies the WatermarkTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkTemplateProperty

Field Value

DependencyProperty

Properties

AdditionalContent

Gets or sets an object which is rendered in ContentPresenter in the right part of the control.

Declaration

cs-api-definition
public object AdditionalContent { get; set; }

Property Value

object

AdditionalContentTemplate

Gets or sets the DataTemplate used for the AdditionalContent object.

Declaration

cs-api-definition
public DataTemplate AdditionalContentTemplate { get; set; }

Property Value

DataTemplate

CurrentText

Gets or sets the text of the TextBox. This property is meant to be used for TwoWay binding in order to be updated on each change of the text and not when the focus is lost.

Declaration

cs-api-definition
public string CurrentText { get; set; }

Property Value

string

DisabledBackground

Gets a value that specifies the background of the control when in disabled state.

Declaration

cs-api-definition
public Brush DisabledBackground { get; set; }

Property Value

Brush

HasLabel

Gets a boolean value indicating whether there is a label.

Declaration

cs-api-definition
public bool HasLabel { get; }

Property Value

bool

IsLabelFloated

Gets a boolean value indicating whether the label is floated.

Declaration

cs-api-definition
public bool IsLabelFloated { get; }

Property Value

bool

IsWatermarkVisible

Gets a value indicating whether the Watermark is visible or not.

Declaration

cs-api-definition
public bool IsWatermarkVisible { get; }

Property Value

bool

KeepLabelFloated

Gets or sets a boolean value indicating whether the label should always stay floated on top.

Declaration

cs-api-definition
public bool KeepLabelFloated { get; set; }

Property Value

bool

Label

Gets or sets the text used as a label.

Declaration

cs-api-definition
public string Label { get; set; }

Property Value

string

LabelStyle

Gets or sets the style of the Label of the RadWatermarkTextBox. This is a dependency property.

Declaration

cs-api-definition
public Style LabelStyle { get; set; }

Property Value

Style

ReadOnlyBackground

Gets a value that specifies the background of the control when in readonly state.

Declaration

cs-api-definition
public Brush ReadOnlyBackground { get; set; }

Property Value

Brush

SelectionOnFocus

Specifies the modification over the selection when the control receives focus.

Declaration

cs-api-definition
public SelectionOnFocus SelectionOnFocus { get; set; }

Property Value

SelectionOnFocus

WatermarkBehavior

Gets a value that specifies when the watermark content of control will be hidden.

Declaration

cs-api-definition
public WatermarkBehavior WatermarkBehavior { get; set; }

Property Value

WatermarkBehavior

WatermarkContent

Gets or sets the content to be shown when the TextBox is empty and not focused.

Declaration

cs-api-definition
public object WatermarkContent { get; set; }

Property Value

object

WatermarkTemplate

Gets or sets the template for presenting the content, shown when the TextBox is empty and not focused.

Declaration

cs-api-definition
public DataTemplate WatermarkTemplate { get; set; }

Property Value

DataTemplate

Methods

EndInit()

Indicates that the initialization process for the element is complete.

Declaration

cs-api-definition
public override void EndInit()

HandleClear()

Called, when the Clear command is invoked.

Declaration

cs-api-definition
protected virtual void HandleClear()

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnInitialized(EventArgs)

Raises the event. This method is invoked whenever is set to true internally.

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Declaration

cs-api-definition
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)

Parameters

e

DependencyPropertyChangedEventArgs