System.Drawing.Color, iterate through properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a way ( perhaps throgh refleksion) to iterate through the colors of
the System.Drawing.Color struct.

foreach (Color color in .... i dont know....

regards Jesper
 
Use the System.Type class, by using typeof(System.Drawing.Color). This
returns an instance of the Type class. You can then use the GetProperties
method to get all of the properties as an array of
System.Reflection.PropertyInfo instances and iterate through the array.

See http://msdn2.microsoft.com/en-us/library/system.type.aspx

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top