RichTextBox special characters?

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

How can I force the RTB to display an ampersand as '&' instead of '&'?
And '<' instead of '&lt;', etc?
 
Terry said:
How can I force the RTB to display an ampersand as '&' instead of '&amp;'?
And '<' instead of '&lt;', etc?

Well, the RTB doesn't do any translation of its own. It just displays
the string you put in it. So may be the string you think has & in it
actually has already had the html stuff encoded? Check in the debugger
what you are actually assigning to the RTB.
 
Terry Olsen said:
How can I force the RTB to display an ampersand as '&' instead of '&amp;'?
And '<' instead of '&lt;', etc?


Replace the entities prior to assigning the string to the richtextbox
control.
 
I'm putting the text in an XML Document, then sending it out via UDP to
another computer, where the InnerText is put into the RTB. Before I used
the RTB, I used a standard TextBox and didn't have this problem. So what
could be changing it? I type in "Captain & Tennill" and get "Captain &amp;
Tennill" at the other end.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top