Last post Jul 07, 2010 08:53 AM by abhikuma225
Jul 07, 2010 07:56 AM|shyam_oec|LINK
have a look at this code
Dim colors() As KnownColor = CType(System.Enum.GetValues(GetType(KnownColor)), KnownColor())
Since CType is a function that returns DataType ,But here as in the code it seems that CType() is returning array having values that is assigned to color() array. How this is happening ?
Please explain this.
Jul 07, 2010 08:10 AM|vik20000in|LINK
i think iit returns only one record which is directly added as the first record of the array in the array
Jul 07, 2010 08:37 AM|shyam_oec|LINK
No,it is returning all values present in the KnownColor Enum .How this is happening ?
Jul 07, 2010 08:53 AM|abhikuma225|LINK
CTYPE converts an expression to specified datatype. Since you are trying to convert to an array. thats why its returning all values in an array.