//添加一个comboBox,一个richTextBox
private void Form1_Load(object sender, EventArgs e)
{
int[] arrFont = { 10, 20, 32, 34, 36, 40 };
for (int i = 0; i < arrFont.Length; i++)
{
comboBox1.Items.Add(arrFont[i]);
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Font font = new Font(FontFamily.GenericSerif,int.Parse(comboBox1.Text), FontStyle.Regular);
richTextBox1.SelectionFont = font;
}
温馨提示:答案为网友推荐,仅供参考