Click here to Skip to main content
15,567,466 members
Articles / Desktop Programming / WPF
Tip/Trick
Posted 28 Dec 2010

Tagged as

Stats

43.5K views
1 bookmarked

Custom WPF TextBox Style

Rate me:
Please Sign up or sign in to vote.
1.80/5 (4 votes)
28 Dec 2010CPOL
TextBox Style which resembles the Twitter's text field.
Download TwitterTextBox for WPF Demo and Source Code



View Image



Introduction



This tip was written to demonstrate how to customize the rendering of the standard TextBox control provided by Microsoft. You can use this custom style to achieve the Twitter's TextBox look and feel.

Using the Style



To make use of the custom Style you need to set the Style property of your TextBox controls.

The example code below demonstrates how to apply the style:

<TextBox Style="{StaticResource TwitterTextBoxStyle}" Height="25" Name="textBox1" Width="300" />


Points of Interest



I have made this TextBox Style as part of my university project. I wanted to add to my application some cool glow effects and animations.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralFYI - Textbox.Tag is bound to the watermark Pin
Bogatitus17-Jun-19 11:34
Bogatitus17-Jun-19 11:34 
GeneralReason for my vote of 1 not helpful Pin
st0rmrd17-Aug-11 2:36
st0rmrd17-Aug-11 2:36 
GeneralThanks for the code sample, just what I needed! Pin
Riaan77721-Jul-11 1:56
Riaan77721-Jul-11 1:56 
GeneralThis is just a short article(tip), it should not be too long... Pin
John_Smith785-Jan-11 0:52
John_Smith785-Jan-11 0:52 
GeneralJohn i am well versed with WPF! but what about others? you s... Pin
Tarun.K.S30-Dec-10 8:38
Tarun.K.S30-Dec-10 8:38 
GeneralThe provided Style definition extends the standard TextBox's... Pin
John_Smith7829-Dec-10 3:19
John_Smith7829-Dec-10 3:19 
GeneralReason for my vote of 2 No explanation at all! Pin
Tarun.K.S29-Dec-10 2:17
Tarun.K.S29-Dec-10 2:17 
Reason for my vote of 2
No explanation at all!
GeneralStill no explanation of what this is all about. Pin
Richard MacCutchan24-Dec-10 7:27
mveRichard MacCutchan24-Dec-10 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.