GridLength Constructors

Definition

Initializes a new instance of the GridLength structure.

Overloads

GridLength(Double)

Initializes a new instance of the GridLength structure using the specified absolute value in pixels.

GridLength(Double, GridUnitType)

Initializes a new instance of the GridLength structure and specifies what kind of value it holds.

GridLength(Double)

Initializes a new instance of the GridLength structure using the specified absolute value in pixels.

C#
public GridLength(double pixels);

Parameters

pixels
Double

The number of device-independent pixels (96 pixels-per-inch).

Exceptions

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GridLength(Double, GridUnitType)

Initializes a new instance of the GridLength structure and specifies what kind of value it holds.

C#
public GridLength(double value, System.Windows.GridUnitType type);

Parameters

value
Double

The initial value of this instance of GridLength.

type
GridUnitType

The GridUnitType held by this instance of GridLength.

Exceptions

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9