Rich TextBox

  • Thread starter Thread starter Mircea Pleteriu
  • Start date Start date
M

Mircea Pleteriu

Hi all,

I have two RichTExtbox controls on a form.
After the user is done editing them a 3rd RTB control shoud contain the
merged contents of the other 2 controls (as the contents of the 2nd control
is appended to the content of the 1st).

Any idea how to achive that?

It does not work by just rtf3 = rtf1 + rtf2.
 
At first glance it looks like you are trying to merge two controls, not
the contents of those controls.

How about

rtf3.appendtext(rtf1.rtf)
rtf3.appendtext(rtf2.rtf)

or

rtf3.rtf = rtf1.rtf & rtf2.rtf
 
I'm back,

I've got a working solution.
Here it is:

this.richTextBox3.SelectionStart = this.richTextBox3.Text.Length;

this.richTextBox3.SelectionLength = 0;

this.richTextBox3.SelectedRtf = this.richTextBox1.Rtf;

this.richTextBox3.SelectionStart = this.richTextBox3.Text.Length;

this.richTextBox3.SelectionLength = 0;

this.richTextBox3.SelectedRtf = this.richTextBox2.Rtf;
 
Back
Top