Re: List Colors At Runtime
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Thu, 17 Jan 2008 13:52:49 +1100
"Derek Hart" <derekmhart@xxxxxxxxx> wrote in message
news:eqxJxWKWIHA.5348@xxxxxxxxxxxxxxxxxxxxxxx
How would I list colors at runtime for System.Drawing.Color - I want to
give the user a list of choices at runtime, such as
System.Drawing.Color.AliceBlue (as an example of one color). I could
recreate this list in a database table and pull from it, but is there a
way to do this in code, to get a full list (for use in a combo, or however
I want to). It would even be useful to programmatically get this list
once to place it into a table. A lot of choices to recreate.
You will need to translate this to VB:
foreach(KnownColor col in Enum.GetValues(typeof(KnownColor)))
{
Color color = Color.FromKnownColor(col);
if(!color.IsSystemColor)
{
Console.WriteLine(col.ToString());
}
}
.
- References:
- List Colors At Runtime
- From: Derek Hart
- List Colors At Runtime
- Prev by Date: Re: right click a tree node
- Next by Date: Re: Email Programming using System.Web.Mail
- Previous by thread: List Colors At Runtime
- Next by thread: Re: List Colors At Runtime
- Index(es):
Relevant Pages
|