Windows apps
Collapse the table of content
Expand the table of content
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.CreateInstance Method (ITypeDescriptorContext, IDictionary)


Creates a SelectionRange object by using the specified type descriptor and set of property values for that object.

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

public override object CreateInstance(
	ITypeDescriptorContext context,
	IDictionary propertyValues


Type: System.ComponentModel.ITypeDescriptorContext

A ITypeDescriptorContext that provides a format context.

Type: System.Collections.IDictionary

An IDictionary that contains the new property values.

Return Value

Type: System.Object

If successful, the newly created SelectionRange; otherwise, this method throws an exception.

Exception Condition

propertyValues is null or its Start and End elements could not be converted into a SelectionRange.

Use the CreateInstance method to make changes to an existing immutable object by creating a modified version of it. This method expects the propertyValues parameter to have elements with key values of Start and End, each with the corresponding DateTime value.

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