Merge RichTextBox TEXT

Posted by srilakshmi15-4307 under C# on 2/3/2012 | Points: 10 | Views : 2539 | Status : [Member] | Replies : 1
System.Windows.Forms.RichTextBox rt1 = new System.Windows.Forms.RichTextBox();
System.Windows.Forms.RichTextBox rt2 = new System.Windows.Forms.RichTextBox();
if (condition)
{
int index = rtf1.LastIndexOf('}');
rtf1 = rtf1.Insert(index, "\\page\\par\r\n"); //Adding the page break
}
string strClipBoardData = System.Windows.Forms.Clipboard.GetText(); //Store clip board data
rt2.Copy();// copy blank data to clip board
rt1.Rtf = rtf1; rt2.Rtf = rtf2; rt2.SelectAll();
rt2.Copy();
rt1.Paste();
retValue = rt1.Rtf;
rt1.Dispose();
rt2.Dispose();
System.Windows.Forms.Clipboard.SetDataObject(strClipBoardData);//Assign clip board data back to the clip board




Responses

Posted by: Naraayanan on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Check this link
http://stackoverflow.com/questions/4994454/appending-contents-of-two-richtextbox-as-a-single-richtext-string

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

srilakshmi15-4307, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response