开发者

Right Aligned TextBlock with TextWrapping wraps at Left Side

开发者 https://www.devze.com 2023-02-19 15:25 出处:网络
I am trying to have a TextBlock align text where multiple lines are on the right side. Currently, the beh开发者_高级运维avior is that the text is aligned to the right for the first line, however the s

I am trying to have a TextBlock align text where multiple lines are on the right side. Currently, the beh开发者_高级运维avior is that the text is aligned to the right for the first line, however the second line starts on the left side. Is there a way to have wrapped lines also align to the right?

<TextBlock HorizontalAlignment="Right" x:Name="txtLeft" Text="the key for the value is two lines+" VerticalAlignment="Top" TextWrapping="Wrap" Margin="0,2,0,0" Grid.Column="0" Grid.Row="0" />


I believe you are looking for the TextAlignment property.

0

精彩评论

暂无评论...
验证码 换一张
取 消