尝试在Windows 8 Metro中包装单选按钮文本

时间:2013-03-31 03:12:08

标签: windows-8 radio-button windows-runtime winrt-xaml

我正在尝试为Windows 8应用程序包装单选按钮文本。

这是我尝试过的代码:

<RadioButton x:Name="ans2" HorizontalAlignment="Left" FontSize="20"
 Margin="10,0,0,10" VerticalAlignment="Center" Click="ansClick">
    <TextBlock Text="RadioButton" TextWrapping="Wrap"/>
</RadioButton>

它没有用,有什么建议吗?

2 个答案:

答案 0 :(得分:3)

试试这个:

<RadioButton>
   <TextBlock Text="This is text" TextWrapping="Wrap" ></TextBlock>
</RadioButton>

答案 1 :(得分:0)

试试这个

  TextBlock txtAnswer = new TextBlock();
  txtAnswer.Foreground = new SolidColorBrush(Colors.White);
  txtAnswer.Text = "CONTENT";
  txtAnswer.TextWrapping = TextWrapping.Wrap;
  CheckBox CheckBoxAnswer = new CheckBox();
  CheckBoxAnswer.Content = txtAnswer;