Solved

Concat 5 RichTextBoxes

Posted on 2010-11-29
6
251 Views
Last Modified: 2012-06-27
I have a form that has 5 RichTextboxes on it, that I would like to concatinate into a final main.RichTextBox  how can this be done?

so far I have the following that will not work

 main.SelectionStart = Len(main.Text)

        emailbody1.SelectionStart = Len(emailbody1.Text)

        emailbody2.SelectionStart = Len(emailbody2.Text)

        emailbody3.SelectionStart = Len(emailbody3.Text)

        emailbody4.SelectionStart = Len(emailbody4.Text)

        emailbody5.SelectionStart = Len(emailbody5.Text)

        main.SelectedRtf = emailbody1.Rtf &
                                       emailbody2.Rtf &
                                       emailbody3.Rtf &
                                       emailbody4.Rtf &
                                       emailbody5.Rtf
0
Comment
Question by:H-SC
  • 3
  • 2
6 Comments
 
LVL 33

Expert Comment

by:jppinto
ID: 34233903
Did your tryed like this:

main.Text= emailbody1.Text & emailbody2.Text & emailbody3.Text & emailbody4.Text & emailbody5.Text

(not tested!)

jppinto
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 500 total points
ID: 34233952
main.SelectedRtf = emailbody1.Rtf
 main.SelectedRtf = emailbody2.Rtf
 main.SelectedRtf = emailbody3.Rtf
etc.
0
 
LVL 1

Author Comment

by:H-SC
ID: 34233982
jppinto,

That was the first thing that I coded assuming that it would work and compiled it that way, and it even works without any errors.  But it drops all of the
emailbody1, 2, 3, 4, 5 formatting when it populates my Main.RichTextBox
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 1

Author Comment

by:H-SC
ID: 34234038
Erick37,

wow!
you are getting all of my points today!

works perfect!

thank you
0
 
LVL 1

Author Comment

by:H-SC
ID: 34234088
Erick37,
One quick question...If I didn't need each on a new line, just back to back, can that be done??
0
 
LVL 32

Expert Comment

by:Erick37
ID: 34234263
main.SelectedRtf.Multiline = false

main.SelectedRtf = emailbody1.Rtf
 main.SelectedRtf = emailbody2.Rtf
 main.SelectedRtf = emailbody3.Rtf

main.SelectedRtf.Multiline = true
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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