复制代码 代码如下:
PropertyInfo[] properties;
ArrayList colors;
Color color;
// SolidBrush brush;
properties = typeof (Color).GetProperties (BindingFlags.Public | BindingFlags.Static);
colors = new ArrayList ();
foreach (PropertyInfo prop in properties)
{
// get the value of this static property
color = (Color) prop.GetValue (null, null);
// skip colors that are not interesting
if (color == Color.Transparent) continue;
if (color == Color.Empty) continue;
try
{
ddlList.Items.Add(prop.Name);
}
catch
{
}
// create a solid brush of this color
//brush = new SolidBrush (color);
//colors.Add (brush);
}
新闻热点
疑难解答
图片精选