문제

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?

도움이 되었습니까?

해결책 2

This must be some strange TextBlock behaviour. I changed the HorizontalAlignment="Left" to HorizontalAlignment="Stretch" and added TextAlignment="Left". Now it wokrks properly.

다른 팁

@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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top