2014-05-02 41 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>