Results 1 to 6 of 6

Thread: Copying from a Rich Text Box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    -
    Posts
    101
    How do I copy the contents of a RichTextBox to another
    RichTextBox including the properties of each text/strings
    (Font, Bold/Italic/Underline, Color)?

    - I'm using VB 6.0 Enterprise Edition
    icq: 16228887

  2. #2
    Guest
    This will save/load contents into a RichTextBox.

    Code:
    'Save
    RichTextBox1.SaveFile "C:\richfile.rtf", rtfRTF
    'Load
    RichTextBox1.LoadFile "C:\richfile.rtf", rtfRTF

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    -
    Posts
    101
    Is there any other way than saving it to a file? Like
    when you press a CommandButton, there's a code which
    transfer or copy the exact format of text from
    RichTextBox1 to RichTextBox2.

    Thanks Matthew!

    - I'm using VB 6.0 Enterprise Edition
    icq: 16228887

  4. #4
    Guest
    Code:
    Private Sub Command1_Click()
    
      RichTextBox2.TextRTF = RichTextBox1.TextRTF
    
    End Sub

  5. #5
    Guest
    TextRTF is the default property, so you can omit it.
    Code:
    RichTextBox2 = RichTextBox1

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    -
    Posts
    101
    Got It!!!

    Thanks guys!!!!
    icq: 16228887

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width