Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42389

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 42389


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>