WebBrowser.DocumentText problem

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

    #1

    WebBrowser.DocumentText problem

    Hello there,

    I use webbrowser loading a web page and want to display the html file
    in a RichtextBox. I find out that the size of the DocumentText is far
    less than the actual size of the html file. So there are only part of
    the html file is showed in the RichtextBox. Anyone has idea about this
    problem? Thanks.

    Lewis

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: WebBrowser.Docu mentText problem

    Lewis,

    How do you expect to transform the content of the HTML file to rich text
    format? The formats are inherently different, and can not be swapped out.

    Also, the reason that the size of the content returned from the
    DocumentText property is less than the actual size of the file is because
    the DocumentText property returns the text, not the HTML markup, so the text
    will always be of smaller size.

    Why not just keep the contents in the web browser control? Do you have
    need to edit it? If you do, then you will need to look into MSHTML hosting
    services to enable editing in the web browser control.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "myzm" <myzmlm@hotmail .com> wrote in message
    news:1138131756 .553730.58300@g 44g2000cwa.goog legroups.com...[color=blue]
    > Hello there,
    >
    > I use webbrowser loading a web page and want to display the html file
    > in a RichtextBox. I find out that the size of the DocumentText is far
    > less than the actual size of the html file. So there are only part of
    > the html file is showed in the RichtextBox. Anyone has idea about this
    > problem? Thanks.
    >
    > Lewis
    >[/color]


    Comment

    • myzm

      #3
      Re: WebBrowser.Docu mentText problem

      The documenttext property indeed return the whole html markup content.
      I just don't know why it got truncated somehow. I need to look at the
      content so I can continue working on my program. All I need is to read
      the content. I don't have authority to change it and I don't intend to
      do so neither.

      Comment

      Working...