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.
 
Back
Top