I have code that has chemical compounds that have small font for the subscript. I currently have this code that transfers it from one RichTextBox
to another one on
From the documentation on msdn:
"The Text property does not return any information about the formatting applied to the contents of the RichTextBox. To get the rich text formatting (RTF) codes, use the Rtf property."
So to assign the value, with formatting, use this:
myRichTextBox.Rtf = otherRichTextBox.Rtf;
I've replaced +=
with =
because I'm not sure you meant to append the value, rather than just replace it. If you do use +=
, you may run into issues due to the "rtf" codes being appended one after the other. However, give it a try... you may not run into any issues at all.