Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2010 Richtextbox selected text fontstyle

$
0
0
In my Rtf Editor I can toggle bold, Italic, and underline. I works fine. Here is the code.

Code:

  With Me.rtbNotes
                If btnBold.Checked Then
                    .SelectionFont = New Font(.SelectionFont, _
                                              .SelectionFont.Style Or FontStyle.Bold)
                Else
                    .SelectionFont = New Font(.SelectionFont, _
                                              .SelectionFont.Style Xor FontStyle.Bold)
                End If
            End With

Only problem if I uncheck the btnBold, btnItalic elsewhere in my RichTextBox and return to a line that contains bold,Italic font. It does not check the btnBold or BtnItalic. Could someone point me in a direction.

Viewing all articles
Browse latest Browse all 27349

Trending Articles