Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer 9 RC stops my WinForms WebBrowser control to work in editing mode

Using the IHtmlDocument2.designMode property set to On to switch a WebBrowser control hosted on a Windows Forms form to editing mode suddenly stopped working after installing Microsoft Internet Explorer 9 RC.

Question:

Any chance to fix this?

I already tried to tweak with doctype or with the EmulateIE7 meta tag but without success.

(An example would be this project)


Update 2011-02-21:

As Eric Lawrence suggested, I adjusted the "Zeta" example to set the document text before setting the edit mode.

Unfortunately I did not manage to switch to design mode, either.


Update 2011-02-24:

Parts of the discussion also take place in Eric's blog.


Update 2011-02-26:

What I currently eperience is that the behaviour seems to be different for HTTP URLs and for content that was added via WebBrowser.DocumentText.

First tests seems to prove this assumption.

I'm now going to build a solution around this assumption and post updates and a proof-of-concept here.


Update 2011-02-26 (2):

I've now built a proof-of-concept with a built-in web server which I believe is also working well with IE 9. If anyone would like to download and test whether it is working and give me a short feedback, I can clean up and release the source code for this.


Update 2011-02-26 (3):

No feedback yet, I still updated the HTML Edit Control article and demo over at the Code Project.


Update 2011-03-16:

Since Internet Explorer 9 was released yesterday, we updated our major products to use the idea with the integrated web server as described in the HTML Edit Control article.

After nearly a month of testing, I think it works quite well.

If you do experience any issues in the future with this approach, please post your comments here and I can investigate and fix.

like image 630
Uwe Keim Avatar asked Dec 09 '22 10:12

Uwe Keim


1 Answers

I had a similar problem and got around it by adding the following line to the DocumentCompleted event:

 ((HTMLBody)_doc.body).contentEditable = "true";
like image 77
LaughingJohn Avatar answered Dec 28 '22 09:12

LaughingJohn