textblock或标记文本垂直堆栈从底部到顶部



如何使wpf Textblock控制堆栈从底部到顶部进行文本,而不是使用固定高度时,而不是从上到下?这是我的意思的示例:

Textblock 带一条线

***********                My Text ***
***********   instead of   ***********
My Text ***                ***********

Textblock 有两行

***********                My Text is 
My Text is    instead of   bigger ****
bigger ****                ***********

有什么方法可以实现这一目标?

简单地将VerticalAlignment属性设置为Bottom怎么样?如果您有围绕实际文本的东西,例如,可以将TextBlock放在GridBorder中,并设置此高度:

<Border Background="Yellow" Height="300">
    <TextBlock VerticalAlignment="Bottom">one line at the bottom</TextBlock>
</Border>

最新更新