Here is my code for styling selected text in richtextbox to italic. However, if the selected text is italic, how can I remove that styling?
private void btnitalic_Click(object sender, EventArgs e)
{
var italictext = this.ActiveControl as RichTextBox;
if (italictext != null)
{
italictext.SelectionFont = new Font(italictext.Font, FontStyle.Italic);
}
}