Advertisement
ASP_Volume3 Miscellaneous #49560

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

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

AI

AI 요약: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

소스 코드
original-source
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
원본 댓글 (3)
Wayback Machine에서 복구됨