New to Telerik UI for WinForms? Start a free 30-day trial

Thickness

Struct

Represents the four side thicknesses used by RichTextEditor layout, including floating-block margins and borders.

Definition

Namespace:Telerik.WinControls.RichTextEditor.UI

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
[TypeConverter(typeof(ThicknessConverter))]
public struct Thickness : IEquatable<Thickness>

Implements: IEquatable<Thickness>

Constructors

Initializes the four sides independently.

C#
public Thickness(double left, double top, double right, double bottom)
Parameters:leftdouble

The left-side thickness.

topdouble

The top-side thickness.

rightdouble

The right-side thickness.

bottomdouble

The bottom-side thickness.

Initializes all four sides to the same thickness.

C#
public Thickness(double uniformWidth)
Parameters:uniformWidthdouble

The thickness assigned to each side.

Properties

Gets or sets the width, in pixels, of the lower side of the bounding rectangle.

C#
public double Bottom { get; set; }
Property Value:

A double that represents the width, in pixels, of the lower side of the bounding rectangle for this instance of Thickness. A pixel is equal to 1/96 of an inch. The default is 0.

Gets or sets the width, in pixels, of the left side of the bounding rectangle.

C#
public double Left { get; set; }
Property Value:

A double that represents the width, in pixels, of the left side of the bounding rectangle for this instance of Thickness. a pixel is equal to 1/96 on an inch. The default is 0.

Gets or sets the width, in pixels, of the right side of the bounding rectangle.

C#
public double Right { get; set; }
Property Value:

A double that represents the width, in pixels, of the right side of the bounding rectangle for this instance of Thickness. A pixel is equal to 1/96 of an inch. The default is 0.

Gets or sets the width, in pixels, of the upper side of the bounding rectangle.

C#
public double Top { get; set; }
Property Value:

A double that represents the width, in pixels, of the upper side of the bounding rectangle for this instance of Thickness. A pixel is equal to 1/96 of an inch. The default is 0.

Methods

Determines whether the specified object is a Thickness with matching side values.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this instance.

Returns:

bool

true if obj is a Thickness whose sides match, including matching NaN values; otherwise, false.

Overrides: ValueType.Equals(object)

Determines whether the corresponding side values are equal.

C#
public bool Equals(Thickness thickness)
Parameters:thicknessThickness

The thickness to compare with this instance.

Returns:

bool

true when each side matches, treating NaN as equal to NaN on the same side; otherwise, false.

Implements: IEquatable<Thickness>.Equals(Thickness)

Returns a hash code derived from all four side values.

C#
public override int GetHashCode()
Returns:

int

A hash code for this thickness.

Overrides: ValueType.GetHashCode()

Returns the string representation of the Thickness structure.

C#
public override string ToString()
Returns:

string

A string that represents the Thickness value.

Overrides: ValueType.ToString()

Operators

Converts each side to an integer Padding value by rounding it.

C#
public static implicit operator Padding(Thickness me)
Parameters:meThickness

The thickness to convert.

Returns:

Padding

A padding with the rounded left, top, right, and bottom values.

Copies the side values from a WinForms padding into a thickness.

C#
public static implicit operator Thickness(Padding me)
Parameters:mePadding

The padding to convert.

Returns:

Thickness

A thickness with the corresponding left, top, right, and bottom values.

Compares two Thickness structures for inequality.

C#
public static bool operator !=(Thickness t1, Thickness t2)
Parameters:t1Thickness

The first structure to compare.

t2Thickness

The other structure to compare.

Returns:

bool

true if the two instances of Thickness are not equal; otherwise, false.

Compares the value of two Thickness structures for equality.

C#
public static bool operator ==(Thickness t1, Thickness t2)
Parameters:t1Thickness

The first structure to compare.

t2Thickness

The other structure to compare.

Returns:

bool

true if the two instances of Thickness are equal; otherwise, false.

Extension Methods