B. *_*non 4 xaml textblock word-wrap radio-button
我有一些XAML:
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="KeyLWP" TextWrapping="Wrap" MaxWidth="120">A Letter or Word or Phrase
</TextBlock>
<StackPanel>
<RadioButton x:Name="rdbtnCandidateVal1" Content="Two wrongs don't make a Wright Brothers Grimm was the Thingamabob Dylan Thomas Jefferson Airplane">
</RadioButton>
Run Code Online (Sandbox Code Playgroud)
...其中,使用分配给RadioButton内容的长字符串,它只是从地球边缘掉落.如果需要,我如何使用TextBlock的TextWrapping和MaxWidth属性来包装它?或者我必须将TextBlock与每个RadioButton配对,避开RadioButton的Content/Text属性吗?
你有一些选择,你可以在单选按钮样式模板中这样做,所以它适用于所有这些,或在实例级别只是一个快速;
<RadioButton>
<RadioButton.Content>
<TextBlock Text="Wrap My Content Pretty Pretty Please" TextWrapping="Wrap"/>
</RadioButton.Content>
</RadioButton>
Run Code Online (Sandbox Code Playgroud)
或者还有其他选项,让我知道是否有特定的情况,我们将得到你的排序.
| 归档时间: |
|
| 查看次数: |
5594 次 |
| 最近记录: |