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

Issue adding rtf to richtextbox

$
0
0
I have two richtextboxes on my form. rtb_chat is read-only and rtb_input isn't. I'm trying to add the text from rtb_input to rtb_chat while keeping the richtextformat. Here is what I have so far:
Code:

        With rtb_chat
            .SelectionStart = .TextLength
            .SelectionLength = 0
            rtb_input.SelectAll()
            .SelectedRtf &= String.Format("{0}{1}: {2}", Environment.NewLine, My.Settings.user, rtb_input.SelectedRtf)
        End With

        rtb_input.Clear()

For whatever reason, nothing gets added to the rtb_chat. My rtb_input text does clear though. Is there any reason why this could be happening?

Edit - Something else I've tried is:
Code:

        rtb_chat.Rtf &= rtb_chat.Rtf
Still get the same results.

Viewing all articles
Browse latest Browse all 27415

Latest Images

Trending Articles



Latest Images

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