Visual Basic Language Reference  

GetType Operator

Returns the type object of the specified type. The type object can be used to retrieve various information about the type such as its properties, methods, and events.

GetType(typename)

Parameters

typename
The name of the type within the class object.

Remarks

The GetType operator returns the type object for the specified typename. If you want to get the type object of an object variable, use Type.GetType Method.

Example

The following examples show the GetType operator in use.

GetType(Integer)   ' Returns the integer class object.
GetType(Project1.Type1)   ' Returns the class object for Project1.Type1.
GetType(String())   ' Returns the class object for 1D string arrays.

See Also

Operator Precedence in Visual Basic | Operators Listed by Functionality | Operators