Link to home
Start Free TrialLog in
Avatar of H-SC
H-SCFlag for United States of America

asked on

Concat 5 RichTextBoxes

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
Avatar of jppinto
jppinto
Flag of Portugal image

Did your tryed like this:

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

(not tested!)

jppinto
ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of H-SC

ASKER

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
Avatar of H-SC

ASKER

Erick37,

wow!
you are getting all of my points today!

works perfect!

thank you
Avatar of H-SC

ASKER

Erick37,
One quick question...If I didn't need each on a new line, just back to back, can that be done??
main.SelectedRtf.Multiline = false

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

main.SelectedRtf.Multiline = true