WPF / XAML:如何使所有文字大写的TextBlock的? [英] WPF/XAML: How to make all text upper case in TextBlock?

查看:574
本文介绍了WPF / XAML:如何使所有文字大写的TextBlock的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在TextBlock中的所有字符显示在大写

I want all characters in a TextBlock to be displayed in uppercase

 <TextBlock Name="tbAbc"
            FontSize="12"
            TextAlignment="Center"
            Text="Channel Name"
            Foreground="{DynamicResource {x:Static r:RibbonSkinResources.RibbonGroupLabelFontColorBrushKey}}" />

中的字符串是通过绑定拍摄。我并不想在字典本身大写的字符串。

The strings are taken through Binding. I don't want to make the strings uppercase in the dictionary itself.

推荐答案

或者使用

Typography.Capitals="AllSmallCaps"

的TextBlock 定义。

在这里看到:<一href=\"https://msdn.microsoft.com/en-us/library/system.windows.documents.typography.capitals(v=vs.110).aspx\">MSDN - Typography.Capitals

编辑:

这不起作用在的Windows Phone 8.1 ,只能在Windows 8.1 ...

This does not work in Windows Phone 8.1, only in Windows 8.1 ...

这篇关于WPF / XAML:如何使所有文字大写的TextBlock的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆