System.Windows.Forms.Padding Structure

Represents padding or margin information associated with a user interface (UI) element.

See Also: Padding Members

Syntax

[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.PaddingConverter))]
public struct Padding

Remarks

The System.Windows.Forms.Padding structure represents the padding or margin associated with a rectangular UI element such as a control. The padding is the internal space between the body of the UI element and its edge. In contrast, a margin is the distance separating the adjoining edges of two adjacent UI elements. Because of structural similarities, System.Windows.Forms.Padding is used to represent both padding and margins.

For a diagram that illustrates the Control.Padding and Control.Margin properties on a control, see Margin and Padding in Windows Forms Controls.

Padding has a different effect on controls that are containers than on controls that are not. For example, in a System.Windows.Forms.Panel control, the System.Windows.Forms.Padding property defines the spacing between the border of the System.Windows.Forms.Panel and its child controls. For a System.Windows.Forms.Button control, the System.Windows.Forms.Padding property defines the spacing between the border of the System.Windows.Forms.Button control and its contained text.

In addition to typical methods and properties, System.Windows.Forms.Padding also defines the following type-level members:

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0