Solved

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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