Thickness 构造函数

定义

初始化 Thickness 结构的新实例。

重载

Thickness(Double)

初始化 Thickness 结构的新实例,此结构的各边使用指定的统一长度。

Thickness(Double, Double, Double, Double)

初始化 Thickness 结构的新实例,该结构具有矩形各边所应用的特定长度(作为 Double 提供)。

Thickness(Double)

初始化 Thickness 结构的新实例,此结构的各边使用指定的统一长度。

public:
 Thickness(double uniformLength);
public Thickness (double uniformLength);
new System.Windows.Thickness : double -> System.Windows.Thickness
Public Sub New (uniformLength As Double)

参数

uniformLength
Double

应用到边框所有四个边的统一长度。

适用于

Thickness(Double, Double, Double, Double)

初始化 Thickness 结构的新实例,该结构具有矩形各边所应用的特定长度(作为 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">

适用于