Rich Text

Posted on 2006-04-04
Last Modified: 2010-04-23
Hello, I have three rich text boxes...

I have content in the first two text boxes that are formated with fonts, colors, etc...  

I want to copy the components from those two rich text boxes to the third one but still maintain the formatting...

How can i do this?
Question by:dev-us
    LVL 85

    Accepted Solution

    Make your selection using SelectionStart() and SelectionLength().  Then use SelectedRtf to grab the formatted selection:

            ' select something in RichTextBox1
            RichTextBox1.SelectionStart = 10
            RichTextBox1.SelectionLength = 25

            ' append to RichTextBox3
            RichTextBox3.SelectionStart = RichTextBox3.TextLength
            RichTextBox3.SelectionLength = 0
            RichTextBox3.SelectedRtf = RichTextBox1.SelectedRtf

    Author Comment

    Idle Mind, you are such a life saver...

    What do you do for a living?
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    Read my profile...   =)

        "I'm a Stay@Home Dad with two kids..."

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now