¿Is there a class to create and manipulate rtf formatted strings?
I have a textbox, which I changed to a rtfbox.
I create long and complex stringVariable, and the I write it to the textBox like:
Code:
MyTextBox.Text=stringVariable
I would like to create a rtf formatted string, and maybe writing it with:
Code:
MyRichtextBox.rtf=stringVariable
but it looks like appending and formatting rtf strings is complex.
I can write to the rich text box utilizing .selection, appending and formatting string by string, but I suspect that it would be slow (was painfully slow with simple TextBox; that was the reason I created the StringVariable previously, and do the copying at the end.
_
Take a look at this sample for a few things you can do with the RTB.
Tanks for your answer, but it look like I have not explained me well:
I ported VB6 code to .NET 2008, and decided that since I need to recode a textBox related code, It would be worty to update to a richtTextBox, -to easy show colored warnings-
I am looking for manipulation of rtf formatted strings without the rtf control, because I expect it to be to much slow, by all that overhead selecting things. And I not expect it to be fast to append new strings. (I recognize I have not experimented)
I need to create long strings, and append data many times.
Repeatedly adding strings to a string variable was really slow, because each time (VB6) added a new string, it reserved new memory, copied the strings, and freed the older.
So I needed to create a longer string than needed (to avoiding reserving new memory each time, and copying the strings to append), and filling it with the mid() function, keeping track of the really utilised part of the string.
but it not works with Rich Text strings, because they have strange codes (to allow all the rich formatting), so, I are looking for code to format and append rich text strings, since I (think) would need to change his memory reserving and appending routines, to avoid heavy string copying.
I think that a class must be already available (or maybe .NET have that implemented), but I can’t found it with Google.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.