共用方式為


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">

適用於