/// <summary>
/// 選擇顏色
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
//是否選擇了顏色
if (colorDialog1.ShowDialog(this) == DialogResult.OK)
{
//System.Drawing.Color.FromArgb
this.textBox2.Text = ColorTranslator.ToHtml(colorDialog1.Color);
this.textBoxA.Text = colorDialog1.Color.A.ToString();
this.textBoxB.Text = colorDialog1.Color.B.ToString();
this.textBoxG.Text = colorDialog1.Color.G.ToString();
this.textBoxR.Text = colorDialog1.Color.R.ToString();
this.textBoxArgb.Text = colorDialog1.Color.ToArgb().ToString();
//1
//this.button1.BackColor = ColorTranslator.FromHtml(this.textBox2.Text.Trim());
//2
//this.button1.BackColor =Color.FromArgb(int.Parse(this.textBoxArgb.Text.Trim()));
//3
this.button1.BackColor = Color.FromArgb(int.Parse(this.textBoxR.Text.Trim()), int.Parse(this.textBoxG.Text.Trim()), int.Parse(this.textBoxB.Text.Trim()));
}
}
/// <summary>
/// 選擇字體
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
if (fontDialog1.ShowDialog(this) == DialogResult.OK)
{
this.textBox1.Text = fontDialog1.Font.ToString();
}
}
哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)成功.---Geovin Du(涂聚文)