O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

GetType Operator

Syntax

GetType(typename)
typename (required; n/a)

The name of a type

Return Value

A Type object containing information about typename

Description

Returns type information about a particular type, such as a class, interface, enumeration, delegate, or structure.

Rules at a Glance

  • typename must be the name of a valid type.

  • Passing an instance variable to typename generates a compiler error.

Programming Tips and Gotchas

If you don’t know the name of the type about which you’d like to get information, but you do have an object instance of that type, you can instead retrieve a Type object using the Type.GetType method.

VB.NET/VB 6 Differences

The GetType operator is new to VB.NET

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required