2014-05-02 30 views
0

出于某种原因,我无法获得此代码在我的程序中工作。
当它溢出宽度时,它会切断中间字。
我认为我做的一切都是正确的。
任何人都可以帮助我吗?单选按钮文字换行

<RadioButton x:Name="answer_4" HorizontalAlignment="Left" Height="96" Margin="809,374,0,0" VerticalAlignment="Top" Width="482" FontSize="22" Foreground="White" Grid.ColumnSpan="2"> 
    <ContentControl> 
     <TextBlock TextWrapping="Wrap"></TextBlock> 
    </ContentControl> 
</RadioButton> 
+0

删除内容控制和检查 – Sajeetharan

回答

0

这样做。

<RadioButton x:Name="answer_4" HorizontalAlignment="Left" Height="96" Margin="809,374,0,0" VerticalAlignment="Top" Width="482" FontSize="22" Foreground="White" Grid.ColumnSpan="2"> 
    <RadioButton.Content> 
     <TextBlock TextWrapping="Wrap" Text="Your_Long_Text_Here" /> 
    </RadioButton.Content> 
</RadioButton> 
+0

这也不能工作。不能使用Text =“”,因为文本是动态提供的。 –

+0

你能告诉我如何喂食文本? – Xyroid

1

你可以试试这个

<RadioButton.ContentTemplate> 
    <DataTemplate> 
     <TextBlock Text="{Binding}" TextWrapping="Wrap" /> 
    </DataTemplate> 
</RadioButton.ContentTemplate>