private void button1_Click(object sender, EventArgs e) { newPanel.Controls.Clear(); int i = 1;
foreach (var item in typeof(Color).GetMembers()) { if (item.MemberType == System.Reflection.MemberTypes.Property && System.Drawing.Color.FromName(item.Name).IsKnownColor == true)//只取属性且为属性中的已知Color,剔除byte属性以及一些布尔属性等(A B G R IsKnownColor Name等) { Label myLable = new Label(); myLable.AutoSize = true;