Home All Groups Group Topic Archive Search About

How can I resolve the control type?

Author
16 Jun 2010 7:00 PM
Mr. X.
Hello.
In VB.NET (VS 2008) :
How can I resolve the control type, by knowing it's name only.
I.e : Panel.

Thanks :)

Author
16 Jun 2010 7:05 PM
Herfried K. Wagner [MVP]
Am 16.06.2010 21:00, schrieb Mr. X.:
> In VB.NET (VS 2008) :
> How can I resolve the control type, by knowing it's name only.
> I.e : Panel.

The name of the type or the name of a control?

--
  M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
16 Jun 2010 8:27 PM
Mr. X.
I have the name of type.
As the following code :
=================
dim s as string
dim t as type
s = "Panel"

I want that :
t = GetType(Panel)
(But on the following code, I have send a type parameter.
I want to send a string parameter).

How can I do that ?

Thanks :)

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:hvb79d$rps$1@news.albasani.net...
> Am 16.06.2010 21:00, schrieb Mr. X.:
>> In VB.NET (VS 2008) :
>> How can I resolve the control type, by knowing it's name only.
>> I.e : Panel.
>
> The name of the type or the name of a control?
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
16 Jun 2010 9:27 PM
Armin Zingler
Am 16.06.2010 22:27, schrieb Mr. X.:
> I have the name of type.
> As the following code :
> =================
> dim s as string
> dim t as type
> s = "Panel"
>
> I want that :
> t = GetType(Panel)
> (But on the following code, I have send a type parameter.
>  I want to send a string parameter).
>
> How can I do that ?

The name "panel" is not unique. A class of that name can be
in many namespaces and in many assemblies (dlls). Therefore you
must specify more details.

Have a look here:  (also read the parameter description)
http://msdn.microsoft.com/en-us/library/w3f99sx1(VS.90).aspx

Also:
http://msdn.microsoft.com/en-us/library/y0cd10tb(VS.90).aspx

--
Armin
Author
17 Jun 2010 6:45 AM
Mr. X.
I looked, as your advise, at the links.
For the second one : I should do something for instance, because instance
should not be nothing.

I know the dlls (or the namespace) for the object.
I need an example, please. Specifically for Panel, in order to understand
something about.

Thanks :)
Author
17 Jun 2010 7:37 AM
Mr. X.
.... I meant Panel in : System.Windows.Forms.Panel

Show quoteHide quote
"Mr. X." <nospam@nospam_please.com> wrote in message
news:O5DK5ieDLHA.5848@TK2MSFTNGP06.phx.gbl...
> I looked, as your advise, at the links.
> For the second one : I should do something for instance, because instance
> should not be nothing.
>
> I know the dlls (or the namespace) for the object.
> I need an example, please. Specifically for Panel, in order to understand
> something about.
>
> Thanks :)