Share via


Conversions.ChangeType Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Converts an object to the specified type.

Namespace:  Microsoft.VisualBasic.CompilerServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

Syntax

'Declaration
Public Shared Function ChangeType ( _
    Expression As Object, _
    TargetType As Type _
) As Object
public static Object ChangeType(
    Object Expression,
    Type TargetType
)

Parameters

  • TargetType
    Type: System.Type
    The type to which to convert the object.

Return Value

Type: System.Object
An object of the specified target type.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.