The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text.

Using Text


     <xctk:WatermarkTextBox Watermark="Enter First Name" />

Using an Image with Text

                <StackPanel Orientation="Horizontal">
                    <Image Source="Contact16.png" Stretch="None" />
                    <TextBlock Text="Enter First Name" Margin="4,0,0,0" />

Custom WatermarkTemplate

        <xctk:WatermarkTextBox Watermark="Enter First Name">
                    <Border BorderBrush="Green" BorderThickness="1">
                        <ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" />

Properties / Events

Property Description
SelectAllOnGotFocus Gets or sets a value indicating whether the entire displayed text will be selected when the control gets focus.
Watermark Gets or sets the object to use in place of null or missing Text.
WatermarkTemplate Gets or sets the DataTemplate to use to display the Watermark.

Get 50+ awesome WPF controls in the Plus Edition.

Last edited May 9, 2013 at 8:52 PM by Kosmatos, version 9


BoucherS Jan 16, 2015 at 12:21 PM 
Issue https://wpftoolkit.codeplex.com/workitem/21667 has been created.

daxfohl Jan 15, 2015 at 7:51 PM 
Any way to have the watermark not disappear until the user starts typing? Many apps need to automatically focus a textbox when initially displaying a page, so the user will never see that watermark in the current implementation, which has it disappear immediately on focus.

BoucherS Sep 24, 2014 at 12:19 PM 
Please vote for it : https://wpftoolkit.codeplex.com/workitem/20095

harshbollu Sep 24, 2014 at 5:27 AM 
Need a passwordbox like WatermarkTextBox

shenglingshi Jul 4, 2014 at 3:32 AM 
Need a passwordbox like WatermarkTextBox

BoucherS Nov 5, 2013 at 12:58 PM 
Please enter an issue in the issue panel.

sonhuytran Nov 5, 2013 at 10:20 AM 
Is there any possibility that I can set password character to this WatermarkTextBox ?

JakubPawlinski Jun 13, 2013 at 1:27 PM 
missing similar passwordbox :(

jogibear9988 Oct 23, 2011 at 7:20 PM 
Found a nice AutoComplete Textbox based on this Control: http://www.mycsharp.de/wbb2/thread.php?threadid=98510 (it supports Phonetic algorithms)