嘿,又是一个关于WPF的问题。在我的XAML代码中,我有一个边框:
<Border x:Name="myBorder" Background="AliceBlue"
Width="200" Height="200"
BorderThickness="10" BorderBrush="Black">
</Border>
在我的代码中的某个地方我增加了 BorderThickness。
double thickness = myBorder.BorderThickness.Bottom + 2;
myBorder.BorderThickness = new Thickness(thickness);
结果是边框的宽度增加了,但不会超出 200x200 的宽度和高度范围,而是在内部减小了尺寸。有没有办法做相反的效果?