0

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.

1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by GliderPilot
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.