Here's an example sub that toggles a font style on and off for a selected piece of text in a richtextbox control, maintaining any other styles the selection has:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ToggleStyle(rtb, FontStyle.Bold)
End Sub
Private Sub ToggleStyle(ByVal rtb As RichTextBox, ByVal style As FontStyle)
If (rtb.SelectionFont.Style And style) = style Then
'Turn off
rtb.SelectionFont = New Font(rtb.SelectionFont, rtb.SelectionFont.Style Xor style)
Else
'Turn on
rtb.SelectionFont = New Font(rtb.SelectionFont, rtb.SelectionFont.Style Or style)
End If
End Sub