How to keep previous font(with style) not change
Posted: Thu Mar 03, 2011 5:12 pm
Hi,
I'm sorry to trouble you. But this problem have made me in puzzle for several days. I have one richviewedit and one richview, just like a chatbox. I want to copy content from richviewedit to richview with style which is defined by user(bold, size, etc.) while the font in richview should keep the prious style.
In my code, if I copy content from richviewedit to richview, the richview will apply the new style for the whole richview. The previous style will be changed. So, my question is how to keep previous font not change while adding new font with style to richview.
My code:
Any help is appreciate!
I'm sorry to trouble you. But this problem have made me in puzzle for several days. I have one richviewedit and one richview, just like a chatbox. I want to copy content from richviewedit to richview with style which is defined by user(bold, size, etc.) while the font in richview should keep the prious style.
In my code, if I copy content from richviewedit to richview, the richview will apply the new style for the whole richview. The previous style will be changed. So, my question is how to keep previous font not change while adding new font with style to richview.
My code:
Code: Select all
TStringStream *sp = new TStringStream();
edt1->SaveRVFToStream(sp, false);
sp->Position = 0;
rchvw1->InsertRVFFromStream(sp, edt1->ItemCount - 1);
rchvw1->Format();
edt1->Clear();
edt1->Format();
delete sp;