Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/margin-and-padding-in-windows-forms-controls.md
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.0 KiB

title, description, ms.date, helpviewer_keywords, ms.assetid
title description ms.date helpviewer_keywords ms.assetid
Margin and Padding in Controls Learn how to add margins and padding in Windows Form controls with the Margin and Padding properties. 03/30/2017
Padding property [Windows Forms]
layout [Windows Forms], margins and padding
Windows Forms, layout
Margin property [Windows Forms]
3781b5a1-3085-4072-bed0-44670c23ffdc

Margin and Padding in Windows Forms Controls

Precise placement of controls on your form is a high priority for many applications. The xref:System.Windows.Forms?displayProperty=nameWithType namespace gives you many layout features to accomplish this. Two of the most important are the xref:System.Windows.Forms.Control.Margin%2A and xref:System.Windows.Forms.Control.Padding%2A properties.

The xref:System.Windows.Forms.Control.Margin%2A property defines the space around the control that keeps other controls a specified distance from the control's borders.

The xref:System.Windows.Forms.Control.Padding%2A property defines the space in the interior of a control that keeps the control's content (for example, the value of its xref:System.Windows.Forms.Control.Text%2A property) a specified distance from the control's borders.

The following illustration shows the xref:System.Windows.Forms.Control.Padding%2A and xref:System.Windows.Forms.Control.Margin%2A properties on a control.

Padding And Margin for Windows Forms Controls

There is design-time support for this feature in Visual Studio. Also see Walkthrough: Laying Out Windows Forms Controls with Padding, Margins, and the AutoSize Property.

See also