I have a Rich Text Box in which the user can open a Font Dialog Box and change the FontStyle of the RTB. This feature works fine, however
after a user makes the text bold or italic they cannot reset it back to regular. How do you do this??

This is the code I have so far:

PMFontDialog.ShowDialog();
if (PMFontDialog.Font.Bold && PMFontDialog.Font.Italic)
{
FontStyle PMFontStyle = FontStyle.Bold | FontStyle.Italic;
txtPMOutgoing.Font = new Font(txtPMOutgoing.Font, PMFontStyle);
}
else if (PMFontDialog.Font.Italic)
{
FontStyle PMFontStyle = FontStyle.Italic;
txtPMOutgoing.Font = new Font(txtPMOutgoing.Font, PMFontStyle);
}
else if (PMFontDialog.Font.Bold)
{
FontStyle PMFontStyle = FontStyle.Bold;
txtPMOutgoing.Font = new Font(txtPMOutgoing.Font, PMFontStyle);
}
else
{
// Make text regular text
 
}

If the user selects Regular in the DialogBox how do I make a FontStyle that is just regular??

Thanks in Advance.

This article has been dead for over six months. Start a new discussion instead.