System.Drawing.Color, iterate through properties

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
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top