I have a TextBlock
with TextTrimming = TextTrimming.CharacterEllipsis
and I want the dots to appear at the beginging. Is there a property for this?
For example if I have the text "123456789ABCDEF" it is displayed "12345678...", but I want it "...89ABCDEF".
Thanks
TextBlock is not editable. Use TextBox instead. Save this answer.
Adding Line Breaks You can do this with a LineBreak inline, added as an XAML element within the text. A new line will be started at the position of this element. If you have configured the text to be justified, the final line before the line break will not be expanded to fill the available width.
Labels usually support single line text output while the TextBlock is intended for multiline text display. For example in wpf TextBlock has a property TextWrapping which enables multiline input; Label does not have this.
TRIM will remove extra spaces from text. Thus, it will leave only single spaces between words and no space characters at the start or end of the text. It is very useful when cleaning up text from other applications or environments. TRIM only removes the ASCII space character (32) from the text.
I had a go at messing about with FlowDirection, it renders the ... at the beginning but still started with 1234 etc.
I did however come across this very similar question:
Ellipsis at start of string in WPF ListView
Someone there has a routine to do it manually. Hope that helps :)
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