Control.Padding Property

Gets or sets the padding inside a control.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

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

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

public function get Padding () : Thickness

public function set Padding (value : Thickness)

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

Property Value

A Thickness. The default value is zero (0).

Padding is the amount of space to insert between the object and its Margin or Border. Padding is specified in the order Left, Top, Right, and Bottom. For more information, see Thickness.

The following example shows how to set the padding property of a control.

<Button Name="btn11" Padding = "5" 
        Click="ChangePadding" TabIndex="1">

No code example is currently available or this language may not be supported.

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