Machaira Posted May 21, 2003 Posted May 21, 2003 I'm trying to use the Rtf property of a RichTextBox as a string, but I'm 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.rtf bug[1].zip Quote Here's what I'm up to.
*Gurus* divil Posted May 22, 2003 *Gurus* Posted May 22, 2003 That's really weird. I get that behaviour too, even using StringBuilder to concatenate text. I was half thinking I wouldn't be able to reproduce it because I'm 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Machaira Posted May 22, 2003 Author Posted May 22, 2003 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 property's Replace function to replace the nulls with an empty string seems to fix it. Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.