I have a textbox that is programmatically added to a canvas at some point and I want all of the text to have a dropshadoweffect, but I don’t want that effect applied to the borders of the textbox itself. How do I do this? Adding a dropshadoweffect to the textbox applies the effect to the borders of the box and “blurs” the text a little but that’s not what I want and I cannot find any properties on the textbox that let me add an effect to the text alone. Do I really have to restyle the textbox or make my own template to achieve this??
Mind you this is a textbox, not a textblock (in which case I would just have copy/pasted from here)
Update: Found a better way, you can skip the
Borderpart if you apply theEffectdirectly to theScrollViewerthat encapsulates the text in the Template.Update 2: Missed the part of creating the
TextBoxin code. Here is the c# equivalent to the Xaml aboveGood question, one idea is to make the Background and BorderBrush Transparent for the
TextBoxand place it in aBorderHere is a comparison with a “normal”
TextBox