0

How can i enable css3 in my c# application WebBrowser element? Somewhat like in this thread?

I'm running IE 10 on windows 8.1

Browser.Version says 11.0.9600.16476

Ben
  • 3,989
  • 9
  • 48
  • 84
  • If I read the blog you're referring to, you need to make sure that at least IE9 or a higher version is installed on the computer that runs your application and you need to set some Windows Registry settings on that computer as well. Did you try that? – kloarubeek Jan 04 '14 at 23:19
  • i need this program to run on other computers as well, so it would be helpfull to know hot to do that from the programm – Ben Jan 04 '14 at 23:23
  • WebBrowser browser = new WebBrowser(); Version ver = browser.Version; If the version < 9, then you need to inform the user to upgrade his browser? – kloarubeek Jan 04 '14 at 23:27
  • it says 11.0.9600.16476 and doesn't run css 3 – Ben Jan 04 '14 at 23:29
  • Follow Tinwor's link below, it explains how to tweak your registry and probably the html you're showing. ps. Don't try to update IE yourself, I think informing the user is sufficient. – kloarubeek Jan 04 '14 at 23:31

2 Answers2

1

The css3 rendering in the WebBrowser userControl it depends on the version of IE that you have installed on your machine. So I reccomend you to upgrade to the latest version. If it dosen't work you need to change a registry Key: take a look here.

If you want use another WebBrowser like chrome try CefSharp(chromium porting for c#)

Community
  • 1
  • 1
Tinwor
  • 7,765
  • 6
  • 35
  • 56
0

The WebBrowser element in WPF uses your local install of Internet Explorer to render the html, so if you have IE8, then it will support CSS 2.1 and a few CSS3 rules. IE 9 and 10 will support even more CSS3 rules, however not all of them.

Alec Moore
  • 1,155
  • 2
  • 10
  • 20
  • You'll have to look at another browser control, because the WebControl will behave differently on other machines. Here is a good Chromium Webrowser Control that will work well with you .NET applicaiton: http://wpfchromium.codeplex.com/ Using this will allow you to use CSS3 and it will look the same on everyone's machine – Alec Moore Jan 04 '14 at 23:30
  • I agree with Alec. The WebControl has some very strange behaviors. But if it's only to show simple html files with not much Javascript and no advanced css3, it might be a lot easier than moving to Chromium... – kloarubeek Jan 04 '14 at 23:34