Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Windows Forms
 Margin and Padding in Windows Forms...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Windows Forms Programming
Margin and Padding in Windows Forms Controls

Precise placement of controls on your form is a high priority for many applications. The System.Windows.Forms namespace gives you many layout features to accomplish this. Two of the most important are the Margin and Padding properties.

The Margin property defines the space around the control that keeps other controls a specified distance from the control's borders.

The Padding property defines the space in the interior of a control that keeps the control's content (for example, the value of its Text property) a specified distance from the control's borders.

The following illustration shows the Padding and Margin properties on a control.

Padding And Margin for Windows Forms Controls

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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker