VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



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

by Dound (7 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

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

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

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

Download this snippet    Add to My Saved Code

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

No comments have been posted about A simple way to add contents from one RichTextBox to another without losing formatting. Why not be the first to post a comment about A simple way to add contents from one RichTextBox to another without losing formatting.

Post your comment

Subject:
Message:
0/1000 characters