Thickness 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 Thickness 结构的新实例。
重载
Thickness(Double) |
初始化 Thickness 结构的新实例,此结构的各边使用指定的统一长度。 |
Thickness(Double, Double, Double, Double) |
Thickness(Double)
Thickness(Double, Double, Double, Double)
public:
Thickness(double left, double top, double right, double bottom);
public Thickness (double left, double top, double right, double bottom);
new System.Windows.Thickness : double * double * double * double -> System.Windows.Thickness
Public Sub New (left As Double, top As Double, right As Double, bottom As Double)
参数
- left
- Double
矩形左侧边的粗细。
- top
- Double
矩形上底的粗细。
- right
- Double
矩形右侧的粗细。
- bottom
- Double
矩形下底的粗细。
示例
以下示例演示如何使用代码创建结构的实例 Thickness 。
myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
myBorder1.BorderThickness = new Thickness(5, 10, 15, 20);
myBorder1.Background = Brushes.AliceBlue;
myBorder1.Padding = new Thickness(5);
myBorder1.CornerRadius = new CornerRadius(15);
Dim myBorder1 As New Border()
myBorder1.BorderBrush = Brushes.SlateBlue
myBorder1.BorderThickness = New Thickness(5, 10, 15, 20)
myBorder1.Background = Brushes.AliceBlue
myBorder1.Padding = New Thickness(5)
myBorder1.CornerRadius = New CornerRadius(15)
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">