hi I want to change the text font of text in rich text box to bold, italic, underline. I have the following code. But if i click another check box,the first check box change disappear. May I know how to fix it
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
richTextBox1.Font = new Font(richTextBox1.Font, FontStyle.Bold);
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
richTextBox1.Font = new Font(richTextBox1.Font, FontStyle.Italic);
}
private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
richTextBox1.Font = new Font(richTextBox1.Font, FontStyle.Underline);
}
private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
richTextBox1.Font = new Font(richTextBox1.Font, FontStyle.Regular);
}