New to Telerik UI for WPFStart a free 30-day trial

Padding

Struct

Represents the padding values around an element in a layout.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
[TypeConverter(typeof(PaddingConverter))]
public struct Padding

Constructors

C#
public Padding(int left, int top, int right, int bottom)
Parameters:leftinttopintrightintbottomint
C#
public Padding(int all)
Parameters:allint
C#
public Padding(Padding other)
Parameters:otherPadding

Fields

C#
public static readonly Padding Empty

Properties

Represents the padding applied to all sides of a layout element.

C#
public int All { get; set; }

Gets or sets the bottom padding value of the layout element.

C#
public int Bottom { get; set; }

Gets or sets the horizontal padding value.

C#
[Browsable(false)]
public int Horizontal { get; }

Gets or sets the left padding value.

C#
public int Left { get; set; }

Gets or sets the right padding value of the layout element.

C#
public int Right { get; set; }

Size

Size

Represents the size of padding, defined by its width and height in the Telerik UI framework.

C#
[Browsable(false)]
public Size Size { get; }

Gets or sets the top padding value.

C#
public int Top { get; set; }

Represents the vertical padding in the layout for Telerik documents.

C#
[Browsable(false)]
public int Vertical { get; }

Methods

Combines two Padding instances into a single Padding instance by adding their respective values.

C#
public static Padding Add(Padding padding1, Padding padding2)
Parameters:padding1Padding

The first Padding instance to be added.

padding2Padding

The second Padding instance to be added.

Returns:

Padding

A new Padding instance that represents the sum of the two specified Padding instances.

Determines whether the specified object is equal to the current Padding instance.

C#
public override bool Equals(object other)
Parameters:otherobject

The object to compare with the current Padding instance.

Returns:

bool

True if the specified object is equal to the current Padding instance; otherwise, false.

Overrides: ValueType.Equals(object)

Gets the hash code for the current instance of the Padding class.

C#
public override int GetHashCode()
Returns:

int

A hash code that is generated based on the properties of the Padding instance.

Overrides: ValueType.GetHashCode()

Subtracts the specified Padding values and returns the resulting Padding.

C#
public static Padding Subtract(Padding padding1, Padding padding2)
Parameters:padding1Padding

The first Padding value to subtract from.

padding2Padding

The Padding value to subtract.

Returns:

Padding

A new Padding that represents the result of the subtraction.

Returns a string representation of the current Padding instance.

C#
public override string ToString()
Returns:

string

A string that represents the current Padding object.

Overrides: ValueType.ToString()

Operators

C#
public static Padding operator -(Padding padding1, Padding padding2)
Parameters:padding1Paddingpadding2PaddingReturns:

Padding

C#
public static bool operator !=(Padding padding1, Padding padding2)
Parameters:padding1Paddingpadding2PaddingReturns:

bool

C#
public static Padding operator +(Padding padding1, Padding padding2)
Parameters:padding1Paddingpadding2PaddingReturns:

Padding

C#
public static bool operator ==(Padding padding1, Padding padding2)
Parameters:padding1Paddingpadding2PaddingReturns:

bool

Extension Methods