Connecting Tech Pros Worldwide Help | Site Map

Trying to use a Rich Text Box

Newbie
 
Join Date: Mar 2009
Posts: 26
#1: Mar 19 '09
I am trying to use a rich text box to document what I am doing. I want as I add text to it that will keep the previouse text. However every time I enter new text the old text disapears. The reason I want to use the Rich Text box was to use different colors for different conditions sent.


Any ideas?

I though of creating a string buffer an having that keep track of what is going on. Is that the correct way. If so how do I make color of certain things?
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,745
#2: Mar 19 '09

re: Trying to use a Rich Text Box


Sharing your code with us would help.
Just clicking in a RTB and typing more text wouldn't cause it to clear the earlier text, so it's hard to say what you're doing.
Newbie
 
Join Date: Mar 2009
Posts: 18
#3: Mar 19 '09

re: Trying to use a Rich Text Box


i also think that you have code that cause this to happen i thinke you may use event of focusing or chaning the control to clear it
Newbie
 
Join Date: Mar 2009
Posts: 26
#4: Mar 19 '09

re: Trying to use a Rich Text Box


Code

ErrorReport.Text.Insert(0,"Hello");

Or

ErrorReport.Text = "Hello";

The first one does not work and the second one does erases everything but the Hello.

Instead what I have been doing is modifying a string

String Page;

If I want to add anything

Page += NewText


Then ErrorReport.Text = Page;

However then I do not know how to get specific parts of the string to be bold/dif color/dif font/ effect.

I am not trying to type in the box it is ment for display purposes only. I wanted to use a RTB so that I could use diff effects for the text for diff error/status codes
Newbie
 
Join Date: Mar 2009
Posts: 18
#5: Mar 19 '09

re: Trying to use a Rich Text Box


have you tried
ErrorReport.Text += "Hello";
Reply