Windows Forms Control to Display HTML

G

Guest

Is there a control for Windows Forms that will display HTML (from either a
variable or a stored file) as it would appear in a browser window?

I'm trying to create a Windows Form that includes a Tab control with two
tabs. One tab includes a text box, and the other should include the control
I'm looking for. When the form is opened, I want to pass a string variable
containing HTML source text and fill both controls, so I can switch back and
forth quickly between source and HTML view, similar to the way FrontPage or
VS handles these pages.

Note that I do not need to edit the HTML text, nor do I need to keep the two
controls synchronized.
 
J

Joshua Flanagan

There is no built-in managed control, but you can safely use the COM Web
Browser control ShDocVW.dll to render HTML.
 
G

Guest

I wouldn't say "safely." ;-) There are some quirks to look out for. For
instance, loading the Webbrowser control and then dismissing the form without
*showing* the control at least once results in a "handle not created" error.
This makes putting the Webbrowser in a TabControl somewhat error-prone.

There's also some other weird behaviors... like with the way it tends to
steal some messages from the parent form when it has the focus.

Still, it works rather well- all things considered.
 

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