How can I get list of all colors I can pick in Visual Studio Designer (which is System.Windows.Media.Colors, but that isn\'t a collection) and put them into my
Here is what I have done in a past ASP.net app:
// populate colors drop down (will work with other kinds of list controls)
Type colors = typeof(System.Drawing.Color);
PropertyInfo[] colorInfo = colors.GetProperties(BindingFlags.Public |
BindingFlags.Static);
foreach ( PropertyInfo info in colorInfo)
{
ddlColor.Items.Add(info.Name);
}
// Get the selected color
System.Drawing.Color selectedColor =
System.Drawing.Color.FromName(ddlColor.SelectedValue);