Edit this page

Getting Started

This tutorial will walk you through the creation of a sample application that contains RadPasswordBox.

Assembly References

In order to use the RadPasswordBox control in your projects, you have to add references to the following assembly:

  • Telerik.Windows.Controls

Adding RadPasswordBox to the Project

Before proceeding with adding RadPasswordBox to your project, make sure the required assembly references are added to the project.

You can add RadPasswordBox manually by writing the XAML code in Example 1. You can also add the control by dragging it from the Visual Studio Toolbox and dropping it over the XAML view.

Example 1: Adding RadPasswordBox in XAML

<telerik:RadPasswordBox Width="150" />

In order to use RadPasswordBox in XAML you have to add the namespace declaration shown in Example 2:

Example 2: Declaring Telerik Namespace


If you run the application you will see the PasswordBox as illustrated in Figure 1.

Figure 1: RadPasswordBox generated by the code in Example 1

Setting Watermark

When RadPasswordBox is empty and not focused, Watermark content can be shown. Example 2 demonstrates how to set Watermark text.

Example 2: Setting a watermark

<telerik:RadPasswordBox Width="150" WatermarkContent="enter a password" />

Figure 2 shows the result.

Figure 2: RadPasswordBoxBox with Watermark set

See Also