how to clone a richtextbox


How can i clone a richtextbox. Or, how can i get text and text formatting from one richtextbox into another.
vbstroehleAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
richTextBox1.SelectAll()
richTextBox1.Copy()
richTextBox2.SelectAll()
richTextBox2.Paste()

0
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Other options...

        RichTextBox2.Rtf = RichTextBox1.Rtf

        ' or

        Dim fileName As String = "c:\temp.rtf"
        RichTextBox1.SaveFile(fileName)
        RichTextBox2.LoadFile(fileName)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.