WatermarkTextBox

This control will display a watermark in a textbox control when no value is assigned to it. As soon as the user starts typing in the textbox the watermark will disappear.

Inherits from System.Windows.Controls.TextBox.

This control is useful to add hints.

A watermark can contain text or any other control such as images:

WatermarkTextBox 02

Properties

Property nameDescription
WatermarkThe watermark to show, can be either a string or a template

How to use

In order to use the simple watermark just set a watermark value to the Watermark property:

<orc:WatermarkTextBox Watermark="Textbox with Watermark" />

In order to add controls or images to the watermark you can define a watermark value like this:

<orc:WatermarkTextBox>
    <orc:WatermarkTextBox.Watermark>
        <StackPanel Orientation="Horizontal">
            <Image Source="/Resources/Images/email.png" />
            <TextBlock Text="Enter the e-mail" />
        </StackPanel>
    </orc:WatermarkTextBox.Watermark>
</orc:WatermarkTextBox>

Contributions

We would like to thank the following contributors:

Want to contribute to the documentation? We have a guide for that!


Questions

Have a question about Catel or WildGums controls? Use StackOverflow with the Catel tag!