Reset Font in RTB

Reply

Join Date: Sep 2006
Posts: 57
Reputation: GliderPilot is an unknown quantity at this point 
Solved Threads: 2
GliderPilot's Avatar
GliderPilot GliderPilot is offline Offline
Junior Poster in Training

Reset Font in RTB

 
0
  #1
Feb 12th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 57
Reputation: GliderPilot is an unknown quantity at this point 
Solved Threads: 2
GliderPilot's Avatar
GliderPilot GliderPilot is offline Offline
Junior Poster in Training

Re: Reset Font in RTB

 
0
  #2
Feb 13th, 2007
Never mind I figured it out. :cheesy:
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 1584 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC