【发布时间】:2010-12-16 21:52:43
【问题描述】:
我成功地让 TextBox 使用父边框高度调整大小,但我需要 TextBox 实际上的高度比父边框小 50 像素。
任何想法如何实现这一目标?
我使用的代码是
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<TextBox x:Name="txtActivityNotes" HorizontalAlignment="Stretch" Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Border}}, Path=ActualHeight}" AcceptsReturn="True" VerticalContentAlignment="Top" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto" />
</Border>
【问题讨论】: