monkeydluffy
monkeydluffy

Reputation: 229

I can't see the full content of the label in WPF

enter image description here

What should I do to see all the content in label? I already used Textblock but I can't still see it's full content...

I am new in WPF so I still don't know what should I do with this problem.

this is my code behind:

        lblFExtension.Content = "Type of File: " + fInfo.Extension;
        lblFName.Content = "File Name: " + fInfo.Name;
        lblFLocation.Content = "File Location: " + fInfo.Directory;
        lblFSize.Content = "File Size: " + Convert.ToString(fileSizeConversion(fInfo.Length));

Upvotes: 0

Views: 223

Answers (2)

Sascha
Sascha

Reputation: 10347

You can use a TextBlock and enable TextWrapping like that:

<TextBlock TextWrapping="Wrap"><![CDATA[
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed neque et tellus    tincidunt interdum. Morbi diam eros, imperdiet at, volutpat et, vestibulum quis, sem. Curabitur eu tellus vel felis molestie malesuada. Pellentesque nec lacus. Aenean fringilla nonummy sapien. Morbi eu odio at turpis cursus tristique. Integer nec lectus sit amet turpis bibendum feugiat. Cras posuere condimentum sapien. Vivamus accumsan, lacus at bibendum vehicula, magna elit consectetuer diam, ac luctus elit diam non leo. Vestibulum lobortis augue nec nisl. Fusce viverra purus consequat lacus. Nullam elementum mattis tellus. In hac habitasse platea dictumst. Aliquam ac velit sit amet urna placerat fringilla. Fusce mattis arcu eget urna. Sed lacus.]]></TextBlock>

It might be that you need to rethink your design, as it might look strange when a value breaks and it has a label. So you could think of splitting the label (eg File name:) and value into two definitions and arrange them accordingly.

Upvotes: 1

CHANDRA
CHANDRA

Reputation: 4928

<TextBlock Height="49" Margin="304,127,53,0"  TextWrapping="Wrap" Text="" VerticalAlignment="Top"/>

adjust your texblock height and then give TextWrapping="Wrap".it will work.Before this you have to check texblock margin

Upvotes: 2

Related Questions