White font with black border in XAML

2019-06-27 10:06发布

as the title says, I would like to have a black font with a white border in my TextBox.

How could it be achieved?

Cheers.

4条回答
Anthone
2楼-- · 2019-06-27 10:35

Check out Blacklight controls @ http://blacklight.codeplex.com/. In particular look at the sample on http://mightymeaty.members.winisp.net/blacklight.silverlight/ | Visual Controls | TEXT | Stroke Text Block (Alpha).

查看更多
我命由我不由天
3楼-- · 2019-06-27 10:47

It's possible to convert text into geometry objects with advanced formatting like outlines and fills for individual letters - you can find out more about how to do that here.

Having said that, I'm not sure that this is possible inside a TextBox. It may be for read-only text (TextBlock) only.

Edit

This blog post shows some advanced font rendering techniques inside a TextBox. It may be handy for you.

查看更多
我只想做你的唯一
4楼-- · 2019-06-27 10:52

What I always do for that is set the font color to white and set a DropShadow effect on the text.

Next, play around with depth, angle (set to 0 or something) and blur and you should be able to get what you want.

查看更多
登录 后发表回答