winfrom 点击按钮button弹框显示颜色集
1.窗体托一个按钮button;
2.单击事件:
1 private void btnForeColor_Click(object sender, EventArgs e) 2 { 3 using (ColorDialog cdialog = new ColorDialog()) 4 { 5 cdialog.AnyColor = true; 6 if (cdialog.ShowDialog() == DialogResult.OK) 7 { 8 this.ForeColor = cdialog.Color; 9 this.btnForeColor.BackColor = this.ForeColor; 10 } 11 } 12 }