Solved

Concat 5 RichTextBoxes

Posted on 2010-11-29
6
249 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataGridview Currency Formating? 22 52
Parallel.ForEach using SendMailAsync() detect when loop is complete 24 52
Programmatically signing Word macros 4 61
Help with Syntax 9 23
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

948 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

19 Experts available now in Live!

Get 1:1 Help Now