• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1156
  • Last Modified:

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.
0
vbstroehle
Asked:
vbstroehle
2 Solutions
 
AlexFMCommented:
richTextBox1.SelectAll()
richTextBox1.Copy()
richTextBox2.SelectAll()
richTextBox2.Paste()

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Other options...

        RichTextBox2.Rtf = RichTextBox1.Rtf

        ' or

        Dim fileName As String = "c:\temp.rtf"
        RichTextBox1.SaveFile(fileName)
        RichTextBox2.LoadFile(fileName)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now