# Thickness 结构

## 定义

``public value class Thickness : IEquatable<System::Windows::Thickness>``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.ThicknessConverter))]
public struct Thickness : IEquatable<System.Windows.Thickness>``````
``type Thickness = struct``
``````Public Structure Thickness
Implements IEquatable(Of Thickness)``````

Thickness

## 示例

``````myBorder2 = new Border();
myBorder2.BorderBrush = Brushes.SteelBlue;
myBorder2.Width = 400;
myBorder2.Height = 400;
myThickness = new Thickness();
myThickness.Bottom = 5;
myThickness.Left = 10;
myThickness.Right = 15;
myThickness.Top = 20;
myBorder2.BorderThickness = myThickness;
``````
``````Dim myBorder2 As New Border()
myBorder2.BorderBrush = Brushes.SteelBlue
myBorder2.Width = 400
myBorder2.Height = 400
Dim myThickness As New Thickness()
myThickness.Bottom = 5
myThickness.Left = 10
myThickness.Right = 15
myThickness.Top = 20
myBorder2.BorderThickness = myThickness
``````
``````<Border BorderBrush="SteelBlue" Width="400" Height="400" Canvas.Left="100" Canvas.Top="100">
<Border.BorderThickness>
10,20,15,5
</Border.BorderThickness>
</Border>
``````

## 注解

### XAML 属性用法XAML Attribute Usage

``````<object property="left"/>
``````

- 或 --or-

``````<object property="left,top"/>
``````

- 或 --or-

``````<object property=" left,top,right,bottom" ... />
``````

### XAML 值XAML Values

leftleft

toptop

rightright

qualifiedDoublequalifiedDouble

`px` （默认值）为 与设备无关的单位（每个单位 1/96 英寸）device-independent units (1/96th inch per unit)`px` (default) is 与设备无关的单位（每个单位 1/96 英寸）device-independent units (1/96th inch per unit)

`in` 为英寸;1in = = 96px`in` is inches; 1in==96px

`cm` 是厘米;1cm = = （96/2.54） px`cm` is centimeters; 1cm==(96/2.54) px

`pt` 为点;1pt = = （96/72） px`pt` is points; 1pt==(96/72) px

## 构造函数

 初始化 Thickness 结构的新实例，此结构的各边使用指定的统一长度。Initializes a new instance of the Thickness structure that has the specified uniform length on each side. 初始化 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.

## 属性

 获取或设置边框底边的宽度（以像素为单位）。Gets or sets the width, in pixels, of the lower side of the bounding rectangle. 获取或设置边框左侧的宽度（以像素为单位）。Gets or sets the width, in pixels, of the left side of the bounding rectangle. 获取或设置边框右边的宽度（以像素为单位）。Gets or sets the width, in pixels, of the right side of the bounding rectangle. 获取或设置边框顶边的宽度（以像素为单位）。Gets or sets the width, in pixels, of the upper side of the bounding rectangle.

## 方法

 比较此 Thickness 结构与另一个 Object 是否相等。Compares this Thickness structure to another Object for equality. 比较此 Thickness 与另一个 Thickness 结构是否相等。Compares this Thickness structure to another Thickness structure for equality. 返回结构的哈希代码。Returns the hash code of the structure. 返回 Thickness 结构的字符串表示形式。Returns the string representation of the Thickness structure.

## 运算符

 比较两个 Thickness 结构的值是否相等。Compares the value of two Thickness structures for equality. 比较两个 Thickness 结构是否不相等。Compares two Thickness structures for inequality.