Type.IsInstanceOfType Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Determines whether the specified object is an instance of the current Type.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

abstract IsInstanceOfType : 
        o:Object -> bool
override IsInstanceOfType : 
        o:Object -> bool


Type: System.Object

The object to compare with the current type.

Return Value

Type: System.Boolean

true if the current Type is in the inheritance hierarchy of the object represented by o, or if the current Type is an interface that o implements. false if neither of these conditions is the case, if o is null, or if the current Type is an open generic type (that is, ContainsGenericParameters returns true).

This method can be overridden by a derived class.


A constructed type is not an instance of its generic type definition. That is, MyGenericList<int> (MyGenericList(Of Integer) in Visual Basic) is not an instance of MyGenericList<T> (MyGenericList(Of T) in Visual Basic).

The following example demonstrates the use of the IsInstanceOfType method.

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

.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top