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.

C#
public Thickness(double uniformLength);

Parameters

uniformLength
Double

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

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

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.

C#
public Thickness(double left, double top, double right, double bottom);

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.

C#
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);
XAML
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10