This must be some strange TextBlock behaviour. I changed the HorizontalAlignment="Left" to HorizontalAlignment="Stretch" and added TextAlignment="Left". Now it wokrks properly.
Textblock displaying "..." instead of "-" when Width="Auto"
Domanda
I have a Textblock that shows 3 Dots instead of a Minus when Width is set to Auto. The Font is Arial and the FontSize
is 20. The Width during Runtime is 7.
<:TextBlock
x:Name="LabelText"
MaxHeight="50"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource TextLabelFontStyle}"
Width="Auto" />
Anyone know why i dont see the Minus?
Soluzione 2
Altri suggerimenti
@Bulli, what nit was saying in his comment is that those 3 dots are added to the end of a TextBlock
when the text does not completely fit into the allowed space when you use a TextTrimming
value of CharacterEllipsis
.
So you have two possible solutions... the first is to follow nit's advice and remove that property from your TextBlock
. As you said that you don't want to do that, the only other option is to make your TextBlock
wider so that the text will fit inside.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow