GetType Operator

   
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

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net