I'm writing a desktop application that uses the
WebBrowser control as a WYSIWYG HTML editor. This is done by casting the control's property
Document.DomDocument to the interface
IHTMLDocument2 and setting the resulting object's
designMode to "On". There is a lot of information on how to do this on the web, if anyone is interested.
I have added stylesheets to the source (with the interface's method
createStyleSheet) so that the editor's content is rendered the same as it will be rendered on our website. This works perfectly, except for one remaining issue.
All of the master pages on our website use the doctype
XHTML 1.1. The editor insists on using the doctype
HTML 4.0 Transitional. This is resulting in some annoying differences in how the content is getting rendered between the editor and the website. I have tried various ways to change the doctype of the
WebBrowser control, from using the interface's
write command to a complete overwrite of the control's
DocumentText; the doctype stubbornly remains transitional.
Does anyone have a suggestion on what I can try next?