See Also: Unit Members
The System.Web.UI.WebControls.Unit structure represents a length measurement that can be expressed in any HTML-compatible size unit. The System.Web.UI.WebControls.UnitType enumeration lists the units of measurement that can be represented. The System.Web.UI.WebControls.Unit is used by properties such as BorderWidth and Height to represent the length or width of the property. For example, you can set the WebControl.BorderWidth property of a Web Server control to a System.Web.UI.WebControls.Unit that represents five pixels.
The System.Web.UI.WebControls.Unit class can represent values only between -32768 and 32767.
Use the Unit.Value property to determine the length of the measurement. The unit of measurement is determined using the Unit.Type property. You can convert other data types to a System.Web.UI.WebControls.Unit by using the Unit.Parse(string), Unit.Percentage(double), Unit.Pixel(int), and Unit.Point(int) methods.