In This Article

Padding Struct

Specifies a set of values for each side of a rectangle.

public struct Padding

Constructors

Padding(Int32)

Initializes a new instance of the Padding class.

public Padding(int allSides)
Parameter Type Description
allSides Int32

The value to assign to all sides.

Padding(Int32, Int32, Int32, Int32)

Initializes a new instance of the Padding class.

public Padding(int left, int top, int right, int bottom)
Parameter Type Description
left Int32

The left value to set.

top Int32

The top value to set.

right Int32

The right value to set.

bottom Int32

The bottom value to set.

Properties

All

Gets or sets all values.

public int All { get; set; }

Property Value

Int32:

All values.

AllSidesEqual

Gets whether the padding is set.

public bool AllSidesEqual { get; }

Property Value

Boolean:

true if any member of the padding is set; otherwise, false.

Bottom

Gets or sets the bottom value.

public int Bottom { get; set; }

Property Value

Int32:

The bottom value.

Empty

Gets an empty Padding object.

public static Padding Empty { get; }

Property Value

Padding:

The empty Padding object that was created.

Horizontal

Gets the combined padding for the right and left values.

public int Horizontal { get; }

Property Value

Int32:

The combined padding for the right and left values.

IsEmpty

Gets whether the padding is set.

public bool IsEmpty { get; }

Property Value

Boolean:

true if any member of the padding is set; otherwise, false.

Left

Gets or sets the left value.

public int Left { get; set; }

Property Value

Int32:

The left value.

Right

Gets or sets the right value.

public int Right { get; set; }

Property Value

Int32:

The right value.

Top

Gets or sets the top value.

public int Top { get; set; }

Property Value

Int32:

The top value.

Vertical

Gets the combined padding for the top and bottom values.

public int Vertical { get; }

Property Value

Int32:

The combined padding for the top and bottom values.

Zero

Gets an Padding object with all sides equal to zero.

public static Padding Zero { get; }

Property Value

Padding:

The Padding object that was created.

Methods

Equals(Object)

Determines whether the specified Object is equal to the current Object.

public override bool Equals(object obj)
Parameter Type Description
obj Object

The Object to compare to the current Object.

Returns

Boolean:

true if the specified Object is equal to the current Object; otherwise, false.

GetHashCode()

Returns a hash code for this object.

public override int GetHashCode()

Returns

Int32:

An integer value that specifies a hash value for this object.

Operators

Equality(Padding, Padding)

Compares two Padding objects. The result specifies whether the property values of the two Padding objects are equal.

public static bool operator ==(Padding left, Padding right)
Parameter Type Description
left Padding

A Padding to compare.

right Padding

A Padding to compare.

Returns

Boolean:

true if the property values of left and right are equal; otherwise, false.

Inequality(Padding, Padding)

Compares two Padding objects. The result specifies whether the property values of the two Padding objects are unequal.

public static bool operator !=(Padding left, Padding right)
Parameter Type Description
left Padding

A Padding to compare.

right Padding

A Padding to compare.

Returns

Boolean:

true if the property values of left and right are unequal; otherwise, false.

Inherited Members