Solved

Concat 5 RichTextBoxes

Posted on 2010-11-29
6
248 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to add field in my script 2 24
Need help with a query 6 55
Encryption Decryption in Oracle 12 61
System32Int Error 8 44
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

23 Experts available now in Live!

Get 1:1 Help Now