Reset Webbrowser control to update settings

早过忘川 提交于 2019-12-13 20:58:42

问题


I want to use C# with a webbrowser control to switch between the Show pictures option of IE, without needing to restart my application.

My current solution

//THE REG FILE:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Display Inline Images"="yes"

The reg file is then executed from my c# project.

System.Diagnostics.Process regeditProcess = System.Diagnostics.Process.Start("regedit.exe", "/s imagesON.reg");
regeditProcess2.WaitForExit();

the code changes the "show images" setting in Internet explorer to true, and loads all images.

However the reg file only works once. Once the webbrowser is created the custom settings of IE is loaded into it and any new settings in IE don't update into the webbrowser control. Instead the webbrowser control has to be disposed and recreated for any new settings in IE to take effect.

so, my question, how can i change the settings in IE and load these new settings into the webbrowser control of my running application, without the need of a restart?

6 Months Later... Still Waiting for a answer here guys :/

来源:https://stackoverflow.com/questions/20843946/reset-webbrowser-control-to-update-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!