效果:
代码:
private void button1_Click(object sender, EventArgs e)
{
richTextBox1.SelectionColor = Color.Blue;
}
private void button2_Click(object sender, EventArgs e)
{
richTextBox1.SelectionColor = Color.Red;
}
private void button3_Click(object sender, EventArgs e)
{
richTextBox1.SelectionFont = new Font("雅黑", 18);
}
private void button4_Click(object sender, EventArgs e)
{
richTextBox1.SelectionFont = new Font("隶书", 20);
}
private void button5_Click(object sender, EventArgs e)
{
richTextBox1.SelectionFont = new Font("楷体", 23);
}
private void button6_Click(object sender, EventArgs e)
{
richTextBox1.SelectionFont = new Font("黑体", 22);
}
private void button7_Click(object sender, EventArgs e)
{
richTextBox1.SelectionBullet = true;
}
private void button8_Click(object sender, EventArgs e)
{
richTextBox1.SelectionBackColor = Color.Gray;
}
private void button9_Click(object sender, EventArgs e)
{
richTextBox1.SelectionFont = new Font("宋体", richTextBox1.Font.Size);
richTextBox1.SelectionColor = Color.Black;
richTextBox1.SelectionBullet = false;
richTextBox1.SelectionBackColor = Color.White;
}