作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想知道是否可以在 WPF 中将 Button
的文本定义为:b c
我试过设置 alt text http://img651.imageshack.us/img651/1838/ctldhrzhy41gbrcch4dpjz4.png
但这似乎不起作用。
Bold
标签是否只能与 FlowDocument
一起使用?
谢谢
最佳答案
使用 TextBlock
来保存格式化的文本:
<Button>
<TextBlock>Hey <Bold>you</Bold>!!!</TextBlock>
</Button>
根据您的评论,如果您想明确说明这会设置 Content
属性,您可以使用 XAML 属性元素语法来实现:
<Button>
<Button.Content>
<TextBlock>Hey <Bold>you</Bold>!!!</TextBlock>
</Button.Content>
</Button>
但是这是多余的,因为 Button
有一个 ContentPropertyAttribute
,这使得第一个版本与第二个版本完全相同。
关于c# - 将按钮的文本设置为在 WPF 中有一些粗体字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2277770/
下面是我用来制作 1px 文本描边轮廓的代码。但是如何使轮廓变粗呢?如果我只是用“5px”替换所有“1px”,结果看起来很疯狂。 HTML Hello! CSS .element { color:
我是一名优秀的程序员,十分优秀!