Home All Groups Group Topic Archive Search About
Author
21 Feb 2006 5:32 AM
Andrew Chalk
After the following line:

Type myType1 = Type.GetType("System.Drawing.Color");

myType1 is "undefined". Why is this? I expected it to be type
System.Drawing.Color.

Many thanks.

Author
21 Feb 2006 12:19 PM
Karl Seguin [MVP]
Considering specifying the assembly name.

System.Drawing.Color, System.Drawing

Karl
Show quoteHide quote
"Andrew Chalk" <ach***@magnacartasoftware.com> wrote in message
news:O6FxRhqNGHA.2912@tk2msftngp13.phx.gbl...
> After the following line:
>
> Type myType1 = Type.GetType("System.Drawing.Color");
>
> myType1 is "undefined". Why is this? I expected it to be type
> System.Drawing.Color.
>
> Many thanks.
>
Author
21 Feb 2006 5:59 PM
Andrew Chalk
Thanks. Same result.

Is there any other way to check that type of an object? Or to manually
construct a Type to test an object.GetType() against?

- A

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
Show quoteHide quote
net> wrote in message news:%23OSOYEuNGHA.2696@TK2MSFTNGP14.phx.gbl...
> Considering specifying the assembly name.
>
> System.Drawing.Color, System.Drawing
>
> Karl
> --
> http://www.openmymind.net/
>
>
>
> "Andrew Chalk" <ach***@magnacartasoftware.com> wrote in message
> news:O6FxRhqNGHA.2912@tk2msftngp13.phx.gbl...
>> After the following line:
>>
>> Type myType1 = Type.GetType("System.Drawing.Color");
>>
>> myType1 is "undefined". Why is this? I expected it to be type
>> System.Drawing.Color.
>>
>> Many thanks.
>>
>
>
Author
21 Feb 2006 6:28 PM
Karl Seguin [MVP]
How odd, it worked for me. You might need to specify the fully quantified
name if it's sitting in the GAC, meaning passing in a public token, culture,
version....

you can check what type an object is via the "is" operator

if (myObject is Drawing)
{
}

Karl

Show quoteHide quote
"Andrew Chalk" <ach***@magnacartasoftware.com> wrote in message
news:ZxIKf.50956$dW3.2600@newssvr21.news.prodigy.com...
> Thanks. Same result.
>
> Is there any other way to check that type of an object? Or to manually
> construct a Type to test an object.GetType() against?
>
> - A
>
> "Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:%23OSOYEuNGHA.2696@TK2MSFTNGP14.phx.gbl...
>> Considering specifying the assembly name.
>>
>> System.Drawing.Color, System.Drawing
>>
>> Karl
>> --
>> http://www.openmymind.net/
>>
>>
>>
>> "Andrew Chalk" <ach***@magnacartasoftware.com> wrote in message
>> news:O6FxRhqNGHA.2912@tk2msftngp13.phx.gbl...
>>> After the following line:
>>>
>>> Type myType1 = Type.GetType("System.Drawing.Color");
>>>
>>> myType1 is "undefined". Why is this? I expected it to be type
>>> System.Drawing.Color.
>>>
>>> Many thanks.
>>>
>>
>>
>
>