RichTextBox RTF Problems

Machaira

Well-known member
Joined
Aug 19, 2002
Messages
325
Location
Abingdon, MD
Im trying to use the Rtf property of a RichTextBox as a string, but Im running into problems with concatenating it with other strings. Anything after the Rtf text is cut off. Has anyone noticed problems with this and, if so, found a fix?

Attached is a simple project so you can see what I mean. Just type some text into the box and click the button. Notice the string after the Rtf text does not get printed in the Output window.
 

Attachments

Thats really weird. I get that behaviour too, even using StringBuilder to concatenate text. I was half thinking I wouldnt be able to reproduce it because Im using VS.NET 2003, but I am.

If I try and concatenate the string using the command window however, it works. It would be worth a post in the newsgroups to see what MS says about it.
 
Posted the problem to the MS newsgroups and got an answer. It appears null characters are tacked on the end of the RTF text which prevents anything from being concatenated to it. Calling the Rtf propertys Replace function to replace the nulls with an empty string seems to fix it.
 

Similar threads

P
Replies
0
Views
117
Paulywog0667_Laptop
P
G
Replies
0
Views
149
guyinkalamazoo3
G
P
Replies
0
Views
101
Paulywog0667_Laptop
P
Back
Top