System.Web.UI.WebControls.UnitType Enumeration

Specifies the unit of measurement.

Syntax

public enum UnitType

Remarks

The System.Web.UI.WebControls.UnitType enumeration represents the different supported measurement units. Measurements can be represented in pixels, points, picas, inches, millimeters, centimeters, percentages, em, or ex.

A UnitType.Point is a unit of measurement that represents 1/72 of an inch.

A UnitType.Pica is a unit that equals 12 points.

A UnitType.Percentage is a unit of measurement that is relative to a parent element. For example, if the font size of a paragraph is 10 pixels, you can place a phrase inside the paragraph with a font size specified as 200%. The font size of the phrase becomes twice the font size of the paragraph, or 20 pixels.

An UnitType.Em is a unit of measurement that is relative to the height of a parent element's font. For example, if the font size of a paragraph is 10 pixels, you can place a phrase inside the paragraph with a font size specified as 2 em. The font size of the phrase becomes twice the font size of the paragraph, or 20 pixels.

An UnitType.Ex is a unit of measurement that is relative to the height of the lowercase letter x of the parent element's font. For example if the font size of a paragraph is 10 pixels, you can place a phrase inside the paragraph with a font size specified as 2 ex. The font size of the phrase becomes twice the font size of a lowercase letter x in the paragraph.

Members

Member NameDescription
Cm

Measurement is in centimeters.

Em

Measurement is relative to the height of the parent element's font.

Ex

Measurement is relative to the height of the lowercase letter x of the parent element's font.

Inch

Measurement is in inches.

Mm

Measurement is in millimeters.

Percentage

Measurement is a percentage relative to the parent element.

Pica

Measurement is in picas. A pica represents 12 points.

Pixel

Measurement is in pixels.

Point

Measurement is in points. A point represents 1/72 of an inch.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0