Padding Struct
Specifies a set of values for each side of a rectangle.
[TypeConverter(typeof(PaddingConverter))]
public struct Padding
Constructors
Padding(Sides, int)
Initializes a new instance of the Padding
class.
public Padding(Sides sides, int value)
Parameter | Type | Description |
---|---|---|
sides | Sides | The sides whose value will be initialized to the given |
value | int | The value to set for the given |
Padding(int)
Initializes a new instance of the Padding
class.
public Padding(int allSides)
Parameter | Type | Description |
---|---|---|
allSides | int | The value to assign to all sides. |
Padding(int, int, int, int)
Initializes a new instance of the Padding
class.
public Padding(int left, int top, int right, int bottom)
Parameter | Type | Description |
---|---|---|
left | int | The left value to set. |
top | int | The top value to set. |
right | int | The right value to set. |
bottom | int | The bottom value to set. |
Properties
All
Gets or sets all values.
AllSidesEqual
Gets whether the padding is set.
[Browsable(false)]
public bool AllSidesEqual { get; }
Property Value
- bool:
true
if any member of the padding is set; otherwise,false
.
Bottom
Gets or sets the bottom value.
Empty
Gets an empty Padding object.
public static Padding Empty { get; }
Property Value
Horizontal
Gets the combined padding for the right and left values.
[Browsable(false)]
public int Horizontal { get; }
Property Value
- int:
The combined padding for the right and left values.
IsEmpty
Gets whether the padding is set.
[Browsable(false)]
public bool IsEmpty { get; }
Property Value
- bool:
true
if any member of the padding is set; otherwise,false
.
Left
Gets or sets the left value.
Right
Gets or sets the right value.
Top
Gets or sets the top value.
Vertical
Gets the combined padding for the top and bottom values.
[Browsable(false)]
public int Vertical { get; }
Property Value
- int:
The combined padding for the top and bottom values.
Zero
Gets an Padding object with all sides equal to zero.
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 |
Returns
- bool:
true
if the specifiedObject
is equal to the currentObject
; otherwise,false
.
GetHashCode()
Returns a hash code for this object.
public override int GetHashCode()
Returns
- int:
An integer value that specifies a hash value for this object.
Operators
operator ==(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
- bool:
true
if the property values ofleft
andright
are equal; otherwise,false
.
operator !=(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
- bool:
true
if the property values ofleft
andright
are unequal; otherwise,false
.
Inherited Members
- ValueType.ToString()
- object.GetType()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)