probably an easier way than this but you could use reflection:
System.Type colorType = typeof(System.Drawing.Color);
System.Reflection.PropertyInfo[] cpi = colorType.GetProperties();
for(int i = 0; i < cpi.Length; i++)
{
if(cpi[i].PropertyType == typeof(System.Drawing.Color))
{
System.Drawing.Color color =
(System.Drawing.Color)cpi[i].GetValue(colorType, null);
Console.WriteLine(color.Name + " = " + color.R + "," + color.G + ","
+ color.B);
}
}
--
HTH
Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
"Trond" <tr***@montanis.com> wrote in message
news:up****************@TK2MSFTNGP10.phx.gbl...
Is there a way i can print out every color in System.Drawing.Color ?
I tried with foreach ( Color c in Color)
but that ain't working. I was thinking that it would be nice to see the
colors in a listbox.
So i am a lil stuck and any hint would help a lot
Best regards
Trond