The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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


Converts the specified SelectionRangeConverter object to another type by using the specified culture.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

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


Type: System.ComponentModel.ITypeDescriptorContext

A ITypeDescriptorContext that provides a format context.

Type: System.Globalization.CultureInfo

The locale information for the conversion.

Type: System.Object

The Object to convert.

Type: System.Type

The destination Type to convert into.

Return Value

Type: System.Object

An Object that represents the converted value.

Exception Condition

destinationType is null.


value cannot be converted to the destinationType.

The ConvertTo method is specialized to convert SelectionRange values to their String or InstanceDescriptor representations. Other types are passed to the base class implementation of this method.

Notes to Inheritors:

Override this method to provide your own conversion requirements.

The context parameter can be used to extract additional information about the environment this converter is being invoked from. The parameter may be null, so you should always verify the information. Also, properties on the context object may also return null.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft