Represents padding or margin information associated with a user interface (UI) element.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Gets or sets the padding value for all the edges.
Gets or sets the padding value for the bottom edge.
Gets the combined padding for the right and left edges.
Gets or sets the padding value for the left edge.
Gets or sets the padding value for the right edge.
Gets the padding information in the form of a System.Drawing.Size.
Gets or sets the padding value for the top edge.
Gets the combined padding for the top and bottom edges.
Computes the sum of the two specifiedvalues.
Determines whether the value of the specified object is equivalent to the current ValueType.Equals(Object).).(Overrides
Generates a hash code for the current ValueType.GetHashCode().). (Overrides
Subtracts one specifiedvalue from another.
Returns a string that represents the current ValueType.ToString().).(Overrides
Performs vector addition on the two specifiedobjects, resulting in a new .
Tests whether two specifiedobjects are equivalent.
Tests whether two specifiedobjects are not equivalent.
Performs vector subtraction on the two specifiedobjects, resulting in a new .
Thestructure 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, is used to represent both padding and margins.
Padding has a different effect on controls that are containers than on controls that are not. For example, in a Panel control, the property defines the spacing between the border of the Panel and its child controls. For a Button control, the property defines the spacing between the border of the Button control and its contained text.
In addition to typical methods and properties,also defines the following type-level members:
The Empty field, which represents a predefined with no padding.
A set of operators for performing common arithmetic operations for the class, such as adding twoobjects together. For languages that do not support operator overloading, you can invoke these members by using alternative method syntax.
The following code example demonstrates how to use the Padding property to create an outline around a RichTextBox control.
For a full code listing, see How to: Create a Border Around a Windows Forms Control Using Padding.
Available since 2.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.