I have a RTF box in my C# WinForms app.
Setting basic styles is fairly simple but when I try to unset the Italic style I lose all other applied styles to the selection font.
if (rtf.SelectionFont.Style.HasFlag(FontStyle.Italic))
{
rtf.SelectionFont = new Font(rtf.SelectionFont.FontFamily, rtf.SelectionFont.Size, rtf.SelectionFont.Style | FontStyle.Regular);
}
else
{
rtf.SelectionFont = new Font(rtf.SelectionFont.FontFamily, rtf.SelectionFont.Size, rtf.SelectionFont.Style | FontStyle.Italic);
}
Is there a way to just de-select the italic property without losing the Bold,underline ect.