C#字体选择框和颜色对话框
2020-03-23 每日一例第15天
1.新建对话框,拖Textbox/label/button;
2.“选择字体”按钮代码;
FontDialog ff = new FontDialog();
if (ff.ShowDialog()==DialogResult.OK)
{
text4.Text = ff.Font.FontFamily.ToString();
}
3.“选择颜色”按钮代码;
ColorDialog cd = new ColorDialog();
if (cd.ShowDialog()==DialogResult.OK)
{
text5.Text = cd.Color.ToString();
}
4.结果展示;