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

Thickness

Struct

Represents pixel thicknesses for the left, top, right, and bottom sides of a layout element.

Definition

Namespace:Telerik.WinControls.Spreadsheet.UI

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

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

Implements: IEquatable<Thickness>

Constructors

Initializes each side 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 value 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 when obj is a matching Thickness; otherwise, false.

Overrides: ValueType.Equals(object)

Determines whether another thickness has matching side values.

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

The value to compare with this instance.

Returns:

bool

true when all corresponding sides are equal, treating NaN values as equal; otherwise, false.

Implements: IEquatable<Thickness>.Equals(Thickness)

Returns a hash code combined from the four side values.

C#
public override int GetHashCode()
Returns:

int

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 the side values to integer WinForms padding, rounding each value to the nearest integer.

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

The thickness to convert.

Returns:

Padding

Padding with the rounded left, top, right, and bottom values.

Converts WinForms padding values to a thickness without changing their integer values.

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

The padding to convert.

Returns:

Thickness

A thickness with matching 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.