This currently goes for WPF, but I need an answer for WinForms aswell, if possible.
I made a user-control that contains a .NET's Label.
The issue is: When the label is long enough, it passes the end of the user-control's size which isn't elegant and can mistake the user to think that the string ends.
What I want to do about it, but don't know how:
Check where the label is getting cut-off from the client's size, then replace the 3 last characters from there with 3 dots "...". (so the user could know that the string didn't end, etc.)
Any suggestions? (just in case: I don't mind making my own user control just for the label). Thanks.
In Winforms: Set the AutoSize property on the label to false and the AutoElipses property to true.
In WPF, you can set the content to a TextBlock with the TextTrimming property set:
<Label Height="29" Width="35" >
<TextBlock TextTrimming="CharacterEllipsis">This is a really long string</TextBlock>
</Label>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With