WebBrowser.DocumentText problem

M

myzm

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
M

myzm

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.
 

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

Top