Thickness Thickness Thickness Thickness Constructors

定義

多載

Thickness(Double) Thickness(Double) Thickness(Double) Thickness(Double)

初始化 Thickness 結構的新執行個體,這個執行個體在每邊都統一指定長度。Initializes a new instance of the Thickness structure that has the specified uniform length on each side.

Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double)

初始化 Thickness 結構的新執行個體,此結構在矩形的每個邊都套用了特定的長度 (以 Double 形式提供)。Initializes a new instance of the Thickness structure that has specific lengths (supplied as a Double) applied to each side of the rectangle.

Thickness(Double) Thickness(Double) Thickness(Double) Thickness(Double)

初始化 Thickness 結構的新執行個體,這個執行個體在每邊都統一指定長度。Initializes a new instance of the Thickness structure that has the specified uniform length on each side.

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

參數

uniformLength
Double Double Double Double

統一套用至週框四邊的長度。The uniform length applied to all four sides of the bounding rectangle.

Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double) Thickness(Double, Double, Double, Double)

初始化 Thickness 結構的新執行個體,此結構在矩形的每個邊都套用了特定的長度 (以 Double 形式提供)。Initializes a new instance of the Thickness structure that has specific lengths (supplied as a Double) applied to each side of the rectangle.

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

矩形左邊的粗細。The thickness for the left side of the rectangle.

top
Double Double Double Double

矩形上邊的粗細。The thickness for the upper side of the rectangle.

right
Double Double Double Double

矩形右邊的粗細。The thickness for the right side of the rectangle

bottom
Double Double Double Double

矩形下邊的粗細。The thickness for the lower side of the rectangle.

範例

下列範例顯示如何使用程式碼來建立Thickness結構的實例。The following example shows how to create an instance of a Thickness structure by using code.

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

適用於