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.Padding Property

Gets or sets a Thickness value that describes the amount of space between a Border and its child element.

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

public Thickness Padding { get; set; }
/** @property */
public Thickness get_Padding ()

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

public function get Padding () : Thickness

public function set Padding (value : Thickness)

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

Property Value

The Thickness that describes the amount of space between a Border and its single child element. This property has no default value.

The following example shows how to set the value of the Padding 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">

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

Community Additions

Show:
© 2014 Microsoft