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