Redigera

Dela via


Thickness Constructors

Definition

Initializes a new instance of the Thickness structure.

Overloads

Thickness(Double)

Initializes a new instance of the Thickness structure that has the specified uniform length on each side.

Thickness(Double, Double, Double, 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)

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)

Parameters

uniformLength
Double

The uniform length applied to all four sides of the bounding rectangle.

Applies to

Thickness(Double, Double, Double, 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)

Parameters

left
Double

The thickness for the left side of the rectangle.

top
Double

The thickness for the upper side of the rectangle.

right
Double

The thickness for the right side of the rectangle.

bottom
Double

The thickness for the lower side of the rectangle.

Examples

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

Applies to