Thickness.Top 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置边框顶边的宽度(以像素为单位)。
public:
property double Top { double get(); void set(double value); };
public double Top { get; set; }
member this.Top : double with get, set
Public Property Top As Double
属性值
Double 的此实例的 Thickness,表示边框顶边的宽度(以像素为单位)。 1 像素等于 1/96 英寸。 默认值为 0。
示例
以下示例演示如何使用可扩展应用程序标记语言 (XAML) 和代码设置属性的值 Top 。
myBorder2 = new Border();
myBorder2.BorderBrush = Brushes.SteelBlue;
myBorder2.Width = 400;
myBorder2.Height = 400;
myThickness = new Thickness();
myThickness.Bottom = 5;
myThickness.Left = 10;
myThickness.Right = 15;
myThickness.Top = 20;
myBorder2.BorderThickness = myThickness;
Dim myBorder2 As New Border()
myBorder2.BorderBrush = Brushes.SteelBlue
myBorder2.Width = 400
myBorder2.Height = 400
Dim myThickness As New Thickness()
myThickness.Bottom = 5
myThickness.Left = 10
myThickness.Right = 15
myThickness.Top = 20
myBorder2.BorderThickness = myThickness
<Border BorderBrush="SteelBlue" Width="400" Height="400" Canvas.Left="100" Canvas.Top="100">
<Border.BorderThickness>
10,20,15,5
</Border.BorderThickness>
</Border>