Reputation: 62488
i am trying to use web browser control in my windows form application.
By default the web browser renders in IE 7 mode.i need to run the application in at least IE 8 but not in compatibility mode, by default the web browser of .Net framework 4 opens in Compatibility mode.
After some search i found that i need to add a key in my regedit. where i have to specify the application name and the required IE version.
I tried this but is not working
var IEVAlue = 8888; // for ie8
var targetApplication = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe";
var keyName = "FEATURE_BROWSER_EMULATION";
RegistryKey myKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl", RegistryKeyPermissionCheck.ReadWriteSubTree);
myKey.SetValue(keyName, IEVAlue, RegistryValueKind.DWord);
Upvotes: 0
Views: 197
Reputation: 5820
I don't know if you're chaning the key in HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER. But it might be important to know if you're running 64-bit or 32 bit.
Under the software node in the registry, there's a node Wow6432, and under that, you also have '\Microsoft\Internet Explorer\MAIN\FeatureControl'.
Can you try changing the value in there and see if it's working?
Upvotes: 1