Solved

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

Posted on 2011-09-16
4
437 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the pointer - the key thing was finding the right search terms to use in Google!

Chris Bray
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now