Solved

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

Posted on 2011-09-16
4
442 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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

705 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