Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unbolding

Status
Not open for further replies.

lothos12345

Programmer
Mar 8, 2005
40
US
I have a button that bolds selected text in an Rtf textbox. The problem is I want to be able to unbold the selected text if they click the bold button again the and the selected text is bolded. Just adding and undo button will not work because the user could have made several changes since bolding the selected text. Basically I want it to work like Word. This has to be in Visual Basic.NET. Any help given is greatly appreciated.
 
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont, FontStyle.Bold)

This is the basic, in order to make it bold. To un-bold it, you have to set it 'FontStyle.Regular'. Use a simple if/else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top