Solved

Webbrowser edit works in XP but not in Windows 7 ??

Posted on 2011-09-16
4
441 Views
Last Modified: 2013-12-17
Hi Guys,

Another one of those Win 7 breaking changes, I guess, like the Print dialog thing and the progress bar issue...

I have an HTML text box based on a web browser control which I use in an email dialog amongst other things, and it works perfectly under XP regardless of how it is used.  However, under Windows 7 it does not accept the cursor and ignores any keypresses.

Can anyone suggest a cause and resolution for this?  

Chris Bray
0
Comment
Question by:chrisbray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
guramrit earned 500 total points
ID: 36553992
This is not because of Windows 7, Its because of IE9 on some systems, if you uninstall IE9 on win7 then you'll see your solution working. For reference, see http://www.codeproject.com/Questions/235977/IE9-disabled-the-Web-Browser-control
0
 
LVL 3

Author Comment

by:chrisbray
ID: 36554011
Hi guramrit:

Thank you for your response - it is certainly useful to know what is causing the issue.  However, even if their system permits asking all my customers to uninstall IE9 is not an option....

Can you suggest how to get around the problem without uninstalling?

Chris Bray
0
 
LVL 3

Author Comment

by:chrisbray
ID: 36554088
Hi guramrit:

Your input enabled me to find the right search terms and google other solutions.

For the benefit of others, the actual solution is to reset the document design mode flag in the DocumentCompleted handler:

        private void WebBrowserBodyDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (webBrowserBody.Document != null)
            {
                var doc = webBrowserBody.Document.DomDocument as IHTMLDocument2;
                if (doc != null)
                {
                    doc.designMode = @"On";
                }
            }
        }

Open in new window

0
 
LVL 3

Author Closing Comment

by:chrisbray
ID: 36554090
Thanks for the pointer - the key thing was finding the right search terms to use in Google!

Chris Bray
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question