标签:button log for font info code names mes one
namespace _17.字体和颜色对话框 private void button1_Click(object sender, EventArgs e)
{
//新建字体对话框对象
FontDialog fd = new FontDialog();
//展示对话框
fd.ShowDialog();
//将选中的字体赋值给textBox的字体
textBox1.Font = fd.Font;
}
private void button2_Click(object sender, EventArgs e)
{
//新建颜色对话框对象
ColorDialog cd = new ColorDialog();
//展示对话框
cd.ShowDialog();
//将选中的颜色赋值给textBox的字体
textBox1.ForeColor = cd.Color;
}
}
}
标签:button log for font info code names mes one
原文地址:https://blog.51cto.com/12679593/2398771