Here's the full MSDN example:
Private Sub ToggleBold()
If richTextBox1.SelectionFont IsNot Nothing Then
Dim currentFont As System.Drawing.Font = richTextBox1.SelectionFont
Dim newFontStyle As System.Drawing.FontStyle
If richTextBox1.SelectionFont.Bold = True Then
newFontStyle = FontStyle.Regular
Else
newFontStyle = FontStyle.Bold
End If
richTextBox1.SelectionFont = New Font( _
currentFont.FontFamily, _
currentFont.Size, _
newFontStyle _
)
End If
End sub
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Arrrr, mateys! Ye needs ta be preparin' yerselves fer
Talk Like a Pirate Day!