RichTextBox special characters?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Olsen

    #1

    RichTextBox special characters?

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


  • Larry Lard

    #2
    Re: RichTextBox special characters?


    Terry Olsen wrote:[color=blue]
    > How can I force the RTB to display an ampersand as '&' instead of '&amp;'?
    > And '<' instead of '&lt;', etc?[/color]

    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.

    --
    Larry Lard
    Replies to group please

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: RichTextBox special characters?

      "Terry Olsen" <tolsen64@hotma il.com> schrieb:[color=blue]
      > How can I force the RTB to display an ampersand as '&' instead of '&amp;'?
      > And '<' instead of '&lt;', etc?[/color]


      Replace the entities prior to assigning the string to the richtextbox
      control.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Terry Olsen

        #4
        Re: RichTextBox special characters?

        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.

        "Larry Lard" <larrylard@hotm ail.com> wrote in message
        news:1149499294 .137079.61820@i 39g2000cwa.goog legroups.com...[color=blue]
        >
        > Terry Olsen wrote:[color=green]
        >> How can I force the RTB to display an ampersand as '&' instead of
        >> '&amp;'?
        >> And '<' instead of '&lt;', etc?[/color]
        >
        > 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.
        >
        > --
        > Larry Lard
        > Replies to group please
        >[/color]


        Comment

        Working...