5

Hello i have a problems in my webbrowser control.

The page aren't displaying like in ie

a busy cat And a busy cat

As you see the top menu isn't working , and many website are glitched

noseratio
  • 59,932
  • 34
  • 208
  • 486
Jason Simard
  • 103
  • 5
  • 18
  • Is that second image from IE on the same computer? – lc. Sep 25 '13 at 23:44
  • This is the way it is supposed to be; it is out-of-the box functionality. If you want it to look like IE (and why on Earth would you want that?), YOU will have to build the menu items and functionality yourself. – Brian Sep 25 '13 at 23:45
  • @Brian: I'm pretty sure the OP is talking about the massive differences in the actual rendering. Not about IE's menus. – NotMe Sep 25 '13 at 23:46
  • I thought the WebBrowser control just used IE's rendering engine? Am I wrong? – lc. Sep 25 '13 at 23:47
  • I am not talking about the control , i am talking about the rendering ! and yes its on the same computer – Jason Simard Sep 25 '13 at 23:50
  • Here we go: http://blogs.msdn.com/b/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx Wonder if this applies to IE9/10 too and would explain the problem – lc. Sep 25 '13 at 23:50
  • @JasonSimard, Chris Lively - Quoted from the post, "As you see the top menu isnt working". As to the rendering issue, that is a whole other can o'worms. – Brian Sep 25 '13 at 23:52
  • @Brain: That would be the menu containing the options "hot", "trending", "vote" and "top". You know, the menu that's actually in the web page. – NotMe Sep 25 '13 at 23:53
  • 2
    Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). – John Saunders Sep 25 '13 at 23:53
  • @ChrisLively - If that is the case, I stand corrected. Regardless, (and because I now get what he is asking), +1. – Brian Sep 25 '13 at 23:53
  • Is this a windows forms application, or WPF? – John Saunders Sep 25 '13 at 23:54
  • 1
    @JasonSimard, a very similar question on IE and `WebBrowser` rendering [answered here](http://stackoverflow.com/a/18802626/1768303). – noseratio Sep 26 '13 at 03:09

1 Answers1

3

One way this can occur is if the browser decides to render in compatibility mode. Meaning IE decides to fix the web developers garbage whereas the webbrowser control doesn't do this automatically.

The best thing to do would be to use the right html doc type in the site. Of course, we all know that most "web programmers" have no idea what that means, and you likely have no control of the sites people are likely to visit with your app.

That said, check out the following. It shows how to inject a header into the web page as you are loading it in order to force the webbrowser control to use compatibility mode.

update decided the link wasn't that great.

see this one instead: How do I turn off Compatibility View on the IE WebBrowserControl in a WinForms app?

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
  • 1
    And buried in one of the answers there was http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation with updated registry key values for IE10 too – lc. Sep 26 '13 at 00:00