Solved

C# Rich Text Box appends string

Posted on 2007-03-29
2
200 Views
Last Modified: 2013-12-17
I apologize if this question has already been answered elsewhere.  I'm having a very difficult time navigating the new site and finding the answers I need in specific subject areas.  That said...

I have a RichTextForm in C# which populates the .rtf property with a literal string.  However, if the form is closed and then reopened, it hangs on to the previous string displayed and adds the string again.  

I'm trying to figure out how to destroy the form and start over each time Print is clicked.  The form is launched from an OnPrint event on a menu bar.

Thanks for any help provided!
0
Comment
Question by:NaughtyZute
2 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 18822775
can u post the code
0
 

Author Comment

by:NaughtyZute
ID: 18824284
My bad.  I never initialized the string to empty at the start of the concatenation.  Well, actually I did, but like a dummy, I put it as formattedString += "the text";... So it never initialized to blank.

Thanks for the reply.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question