string[] colors = Enum.GetNames(typeof(System.Drawing.KnownColor));
或者
使用反射来得到了的System.Drawing.Color的颜色结构:
System.Collections.Generic.List<string> colors = new System.Collections.Generic.List<string>(); Type t = typeof(System.Drawing.Color); System.Reflection.PropertyInfo[] infos = t.GetProperties(); foreach (System.Reflection.PropertyInfo info in infos) if (info.PropertyType == typeof(System.Drawing.Color)) colors.Add(info.Name);
English Language Content
|