Telerik UI for Windows Phone by Progress

This article explains how to use the ClearButton of RadTextBox.

ClearButton

The ClearButton is a RadImageButton. It appears when the end user starts typing in the text box and when it is tapped it deletes all the text and disappears again. When the ClearButton is tapped. The ClearButtonTap event is fired and the ClearButtonCommand is executed with the ClearButtonCommandParameter.

ClearButtonVisibility

The ClearButton can be removed if it is not necessary for some reason. This happens by setting the ClearButtonVisibility property to Collapsed.

ClearButtonStyle

The style of the ClearButton can be easily modified with the ClearButtonStyle property. The new style should have a TargetType telerikPrimitives:RadImageButton

For example, here is how you can change the ClearButton's Foreground and add Background:

CopyXAML
<telerikPrimitives:RadTextBox ActionButtonVisibility="Visible">
    <telerikPrimitives:RadTextBox.ClearButtonStyle>
        <Style TargetType="telerikPrimitives:RadImageButton">
            <Setter Property="Foreground" Value="Yellow"/>
            <Setter Property="Background" Value="Aqua"/>
        </Style>
    </telerikPrimitives:RadTextBox.ClearButtonStyle>
</telerikPrimitives:RadTextBox>

And here is the result:

Text Box-Features-Clear Button-01