Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiline Radiobutton

I've radio buttuons in my WP-8 application.

All contents of my radiobuttons are overlapping. I've fixed height and width but words are not wrapping to second line. How can I solve this problem?

Please do not say something like "\n" content is dynamic.

like image 885
Diga Avatar asked Apr 14 '26 15:04

Diga


1 Answers

You are probably setting text to Content property as a string. But you can also use TextBlock.

XAML

<RadioButton>
    <TextBlock Text="This is very long text that I want to wrap. Is it long enough?" 
               TextWrapping="Wrap"/>
</RadioButton>

C#

RadioButton rb = new RadioButton();
rb.Content = new TextBlock()
{
    Text = "This is very long text that I want to wrap. Is it long enough?",
    TextWrapping = TextWrapping.Wrap,
};

Result
screenshot

like image 162
Łukasz Rejman Avatar answered Apr 21 '26 00:04

Łukasz Rejman