Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Border.BorderThickness Property

Gets or sets the relative Thickness of a Border.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public Thickness BorderThickness { get; set; }
/** @property */
public Thickness get_BorderThickness ()

/** @property */
public void set_BorderThickness (Thickness value)

public function get BorderThickness () : Thickness

public function set BorderThickness (value : Thickness)

<object>
  <object.BorderThickness>
    <Thickness .../>
  </object.BorderThickness>
</object>
<object BorderThickness="Thickness" .../>

Property Value

The Thickness that describes the width of the boundaries of the Border. This property has no default value.

The following example shows how to set the value of the BorderThickness property by using Extensible Application Markup Language (XAML) and 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);

<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

More Code

How to: Wrap a Border Around the Content of a Canvas

This example shows how to wrap a Canvas element with a Border.

How to: Use a ThicknessConverter Object

This example shows how to create an instance of ThicknessConverter and use it to change the thickness of a border.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft