This is a migrated thread and some comments may be shown as answers.

Styling the Watermark text

1 Answer 217 Views
WatermarkTextBox
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 02 Apr 2012, 06:00 PM
Hi,

I need to set the foreground color of the watermark to Silver or a shade of gray & font style to italic. And, I need the text (entered by user) to be in black & font style to be normal.

How do I do this? I tried using the WatermarkTemplate but I'm not able to get the desired style. Please help me in this regard.

Thanks

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 04 Apr 2012, 10:58 AM
Hi Scott,

You could use the following code:

<!--TODO: Do your custom styling here. -->
<telerik:RadWatermarkTextBox Foreground="Green" WatermarkContent="Enter your text here...">
    <telerik:RadWatermarkTextBox.WatermarkTemplate>
        <DataTemplate>
            <!--TODO: Do your custom styling here. -->
            <TextBlock Foreground="Pink" Text="{Binding}" />
        </DataTemplate>
    </telerik:RadWatermarkTextBox.WatermarkTemplate>
</telerik:RadWatermarkTextBox>

I also attached the project I used to try it.

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
WatermarkTextBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or