Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

OpacityConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)

Returns a value indicating whether this converter can convert an object of the specified source type to the native type of the converter that uses the specified context.

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

public override bool CanConvertFrom(
	ITypeDescriptorContext context,
	Type sourceType


Type: System.ComponentModel.ITypeDescriptorContext

A ITypeDescriptorContext that provides information about the context of a type converter.

Type: System.Type

The Type that represents the type you want to convert from.

Return Value

Type: System.Boolean
true if this converter can perform the conversion; otherwise, false.

The sourceType is expected to be a String.

Notes to Inheritors

Override this method to provide your own conversion requirements.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft