Unit Constructor (String)
Initializes a new instance of the Unit structure with the specified length.
Assembly: System.Web (in System.Web.dll)
Use this constructor to create and initialize a new instance of the Unit structure using the specified length. The length is specified in two parts, the length's value and the length's unit type. For example, "200Cm" represents a length of 200 centimeters. You can use any valid CSS-compliant unit expression.
The following table lists the common unit types.
Length in pixels.
Length in points. A point represents 1/72 of an inch.
Length in inches.
Length in millimeters.
Length in centimeters.
Length as a percentage of the parent element.
The following table shows initial property values for an instance of Unit.
If value is not between -32768 and 32767, an exception is thrown.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.