BorderThickness Property
Collapse the table of content
Expand the table of content

Border.BorderThickness Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the thickness of the border.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public Thickness BorderThickness { get; set; }
<Border BorderThickness="uniform"/>
- or -
<Border BorderThickness="left&right,top&bottom"/>
- or -
<Border BorderThickness="left,top,right,bottom"/>

XAML Values


A value measured by logical pixels that specifies a uniform Thickness. The uniform value is applied to all four Thickness properties (Left, Top, Right, Bottom).


A value measured by logical pixels that specifies the Left and Right of a symmetrical Thickness.


A value measured by logical pixels that specifies the Top and Bottom of a symmetrical Thickness.

left top right bottom

Values measured by logical pixels that specify the four possible dimension properties of a Thickness structure (Left, Top, Right, Bottom).

  • In the XAML syntaxes shown, you can use a space rather than a comma as the delimiter between values.

  • See Remarks for value type, value bounds, and edge-case considerations that affect both code and XAML usages of BorderThickness.

Property Value

Type: System.Windows.Thickness
The thickness of the border in logical pixels. The default is 0 on all four sides.

Dependency property identifier field: BorderThicknessProperty

The BorderThickness must be set to a nonzero value in order for a border to be visible. If the thickness is a positive value, the border is drawn inside the object's bounding box. If the thickness is negative, the border is drawn outside the object's bounding box.

You can set a uniform thickness for all sides of the border or set a specific value for each side. For details, see Thickness.

Nonintegral values of a Thickness for BorderThickness are technically permitted, but should generally be avoided. Nonintegral values introduce subpixel rendering, which can possibly result in antialiasing artifacts.

Negative values for Thickness values are technically permitted, but should be used with caution when setting the BorderThickness property. Negative values cause drawing outside the normal areas assigned for layout, but they could be used in this way for deliberate effect.

The following example shows how to set a varying thickness for the border.

<Border BorderThickness="3,10,10,3" BorderBrush="Blue" Grid.Column="0" Grid.Row="2">
    <TextBlock Text="Thickness" />

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft