WPF中复选框左侧的文本? [英] Text on the left side of checkbox in WPF?
本文介绍了WPF中复选框左侧的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将复选框内容(文字)放在复选框本身的左侧最简单的方法是什么?
What is the easiest way to put checkbox content (text) on the left side of the checkbox itself?
推荐答案
最大化容易性和正确性的解决方案是使 LeftToRight
内容
A solution that maximizes "easiness" and "correctness" is to make a RightToLeft
checkbox with LeftToRight
content:
<CheckBox FlowDirection="RightToLeft">
<TextBlock FlowDirection="LeftToRight" Text="CheckBox Content:" />
</CheckBox>
或如果您想要样式:
<Style TargetType="CheckBox">
<Setter Property="FlowDirection" Value="RightToLeft" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<ContentControl FlowDirection="LeftToRight" Content="{Binding}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
这篇关于WPF中复选框左侧的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文