Re: Alernative for Gettype
Urs Eichmann <[email protected]> Wed, 19 Jun 2002 17:16:16 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.general |
|---|---|
| Message-ID | <0AA9584981D2D311AED10004ACA2494B21ABF2@PRSRVNT> |
What you try to do, getting the type of System, is not valid, since System
is not a type but a Namespace.
If you want to get the type of a real type, e.g. Control, you can use
Dim ty as Type = GetType(System.Windows.Forms.Control)
There is an alternative: If you hold a reference to an object, you can use
the following:
Dim ctrl As System.Windows.Forms.Control
Dim ty As Type = ctrl.GetType
Urs
> -----Ursprüngliche Nachricht-----
> Von: george antony [mailto:[email protected]]
> Gesendet: Mittwoch, 19. Juni 2002 15:45
> An: [email protected]
> Betreff: [DOTNET] Alernative for Gettype
>
>
> Hi all
> Is there any alternative for GetType()
> Gettype Takes type as a parameter.
> I am not able to type cast a string into type object.
> as per my requirement
>
> regards
> george
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.