This documentation is archived and is not being maintained.

Unit Constructor (Int32)

.NET Framework 1.1

Initializes a new instance of the Unit structure with the specified 32-bit signed integer.

[Visual Basic]
Public Sub New( _
   ByVal value As Integer _
public Unit(
   int value
public: Unit(
   int value
public function Unit(
   value : int


A 32-bit signed integer that represents the length of the Unit in pixels.


Exception Type Condition
ArgumentOutOfRangeException The value parameter contains a value that is not between -32768 and 32767.


Use this constructor to create and initialize a new instance of the Unit structure using the specified 32-bit signed integer.

The following table shows initial property values for an instance of Unit.

Property Initial Value
Type UnitType.Pixel
Value The value specified by the value parameter.
CAUTION   If the specified value is not between -32768 and 32767, an exception is thrown.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Unit Structure | Unit Members | System.Web.UI.WebControls Namespace | Unit Constructor Overload List | Value | Type