ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
Collapse the table of content
Expand the table of content

FontUnitConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

Converts a FontUnit to an object with a different data type.

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

public override Object ConvertTo(
	ITypeDescriptorContext context,
	CultureInfo culture,
	Object value,
	Type destinationType


Type: System.ComponentModel.ITypeDescriptorContext
An System.ComponentModel.ITypeDescriptorContext implemented object that provides information about the context of a type converter.
Type: System.Globalization.CultureInfo
A System.Globalization.CultureInfo that specifies the culture to represent the FontUnit, when it is expressed in points.
Type: System.Object
A System.Object that represents the FontUnit to convert.
Type: System.Type
A System.Type that represents the data type to convert to.

Return Value

Type: System.Object
A System.Object that represents the converted value.

Use the ConvertTo method to convert the FontUnit specified by the value parameter to an object with the data type specified by the destinationType parameter.


String.Empty is returned from this method if the value parameter contains null. String.Empty is also returned if the Type property of the FontUnit specified by the value parameter contains the value FontSize.NotSet.


This method can only convert a FontUnit to a string.

.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.

Community Additions

© 2016 Microsoft