public static System.Drawing.Color GetSystemColor(int i) { Array Colors = System.Enum.GetValues(typeof(System.Drawing.KnownColor)); System.Drawing.KnownColor[] allColors = new System.Drawing.KnownColor[Colors.Length]; Array.Copy(Colors, allColors, Colors.Length); if (i < Colors.Length) { return System.Drawing.Color.FromName(allColors[i].ToString()); } else { return System.Drawing.Color.Red; } }
时间: 2024-12-06 10:07:02