In my previous article "Customizing Slider Control
In Silverlight 3" we saw some customization of Slider control. In this article
we will see how can we customize our common TextBox Control. In this sample I
will show you how you can change the Text ForeGround and the CaretBrush.
Creating Silverlight 3 Application
Open up Blend 3 and
create a Silverlight 3 Application.
- Go ahead and draw a TextBox into your Grid and make it larger so that you
can see the changes clearly.
have changed the Back ground color as black and the Foreground as Linear
Gradient Brush. Here is the Xaml code for your reference.
we will change the CaretBrush, Caret is nothing but a vertical line. When you
type something in the TextBox one thin line used to blink. The default color for
it is Black. Now we will modify to match to our Foreground Text.
- Select the CaretBrush and change the Brush to LinearGradient Brush.
course you can't see the Caret while you design. So run your application and now
try to type something in the TextBox. You will be able to see the Caret changed
to its Linear Gradient Color that we have provided.
is the XAML code for your reference.
That's it you have successfully
customized your TextBox control.
You can also download the sample code used in the above example.