using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//设置在颜色对话框中显示“颜色”选项
fontDialog1.ShowColor = true;
//设置包含应用按钮
fontDialog1.ShowApply = true;
fontDialog1.ShowDialog();
label1.Font = fontDialog1.Font;
label1.ForeColor = fontDialog1.Color;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//设置在颜色对话框中显示“颜色”选项
fontDialog1.ShowColor = true;
//设置包含应用按钮
fontDialog1.ShowApply = true;
fontDialog1.ShowDialog();
label1.Font = fontDialog1.Font;
label1.ForeColor = fontDialog1.Color;
}
}
}