Diga
Diga

Reputation: 491

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.

Upvotes: 3

Views: 1103

Answers (1)

Łukasz Rejman
Łukasz Rejman

Reputation: 1892

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

Upvotes: 4

Related Questions