This documentation is archived and is not being maintained.

FontUnit Structure

Represents the size of a font.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[SerializableAttribute]
[TypeConverterAttribute(typeof(FontUnitConverter))]
public value class FontUnit

The FontUnit type exposes the following members.

  NameDescription
Public methodFontUnit(Double)Initializes a new instance of the FontUnit class with the specified font size in points.
Public methodFontUnit(FontSize)Initializes a new instance of the FontUnit class with the specified FontSize.
Public methodFontUnit(Int32)Initializes a new instance of the FontUnit class with the specified font size.
Public methodFontUnit(String)Initializes a new instance of the FontUnit class with the specified string.
Public methodFontUnit(Unit)Initializes a new instance of the FontUnit class with the specified Unit.
Public methodFontUnit(Double, UnitType)Initializes a new instance of the FontUnit class with the specified font size and UnitType value.
Public methodFontUnit(String, CultureInfo)Initializes a new instance of the FontUnit class with the specified string using the specified System.Globalization::CultureInfo object.
Top

  NameDescription
Public propertyIsEmptyGets a value that indicates whether the font size has been set.
Public propertyTypeGets a FontSize enumeration value that represents the font size.
Public propertyUnitGets a Unit that represents the font size.
Top

  NameDescription
Public methodEqualsDetermines whether the specified System::Object is equivalent to the instance of the FontUnit class that this method is called from. (Overrides ValueType::Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Overrides ValueType::GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberParse(String)Converts the specified string to its FontUnit equivalent.
Public methodStatic memberParse(String, CultureInfo)Converts the specified string to its FontUnit equivalent in the specified culture.
Public methodStatic memberPointCreates a FontUnit of type System.Drawing::Point from an integer value.
Public methodToString()Converts the FontUnit object to the default string representation. (Overrides ValueType::ToString().)
Public methodToString(CultureInfo)Converts the FontUnit object to a string representation, using the specified System.Globalization::CultureInfo.
Public methodToString(IFormatProvider)Converts a FontUnit object to a string equivalent using the specified format provider.
Top

  NameDescription
Public operatorStatic memberEqualityCompares two FontUnit objects for equality.
Public operatorStatic memberImplicit(Int32 to FontUnit)Implicitly creates a FontUnit of type System.Drawing::Point from an integer value.
Public operatorStatic memberInequalityCompares two FontUnit objects for inequality.
Top

  NameDescription
Public fieldStatic memberEmptyRepresents an empty FontUnit object.
Public fieldStatic memberLargeRepresents a FontUnit object with the Type property set to FontSize.Large.
Public fieldStatic memberLargerRepresents a FontUnit object with the Type property set to FontSize.Larger.
Public fieldStatic memberMediumRepresents a FontUnit object with the Type property set to FontSize.Medium.
Public fieldStatic memberSmallRepresents a FontUnit object with the Type property set to FontSize.Small.
Public fieldStatic memberSmallerRepresents a FontUnit object with the Type property set to FontSize.Smaller.
Public fieldStatic memberXLargeRepresents a FontUnit object with the Type property set to FontSize.XLarge.
Public fieldStatic memberXSmallRepresents a FontUnit object with the Type property set to FontSize.XSmall.
Public fieldStatic memberXXLargeRepresents a FontUnit object with the Type property set to FontSize.XXLarge.
Public fieldStatic memberXXSmallRepresents a FontUnit object with the Type property set to FontSize.XXSmall.
Top

For a list of initial property values for an instance of FontUnit, see the FontUnit constructor.

The following code example demonstrates how to use a Style object to change the style properties for multiple controls at one time. Each time one of the Style property values changes, each control must call its ApplyStyle method. Not all the controls included in this example support all the properties that are demonstrated. If a control does not support a particular property, the appearance of the control will not change when the property value is changed.

Security noteSecurity Note

This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: