How do I easily create an example chart of all colors

  • Thread starter Thread starter Grober
  • Start date Start date
G

Grober

I know how to get all the colour names by looping through
the KnownColors enumeration. But how can I use that to
actually get the colours, e.g. by adding a grid item for
each colour and changing the items' back colours to each
of the KnownColors.

Regards
/Grober
 
Grober,

You can get the color for that color name by passing the enumeration
value to the static FromKnownColor method on the Color structure.

Hope this helps.
 
Thanks, it worked. I also found the
ColorConverter.ConvertFromString method which I could use
on the string array I created from the KnownColors
enumaration.

So many methods, so little time...

Regards
/Grober
-----Original Message-----
Grober,

You can get the color for that color name by passing the enumeration
value to the static FromKnownColor method on the Color structure.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I know how to get all the colour names by looping through
the KnownColors enumeration. But how can I use that to
actually get the colours, e.g. by adding a grid item for
each colour and changing the items' back colours to each
of the KnownColors.

Regards
/Grober


.
 
Back
Top