Search Tools Links Login

A simple way to add contents from one RichTextBox to another without losing formatting


Visual Basic 6, or VB Classic

This shows how the richtext of one richtextbox control can be inserted into another without losing any of its formatting.

Original Author: Dound

Code

Private Sub cmdAddRTBs_Click() 'Adds rtb2 to the end of rtb1
  'Set insert point (can be at ANY point in rtb1)
  rtb1.SelStart = Len(rtb1.Text)
  
  'Select rich text to add
  rtb2.SelStart = 0
  rtb2.SelLength = Len(rtb2.Text)
  
  'Add the selected rich text
  rtb1.SelRTF = rtb2.SelRTF
End Sub

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 116 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.