click on a link event webbrowser c#?

不打扰是莪最后的温柔 提交于 2019-12-18 09:04:47

问题


I want to open a link in IE browser from the web browser control in my winform ... the webbrowser control navigate to a page when the user click on a link it opens in the internet explorer browser.


回答1:


Basically handle the WebBrowser.Navigating Event, cancel the navigation and open up the url in explorer like this:

private void WebBrowserNavigating(object sender, WebBrowserNavigatingEventArgs e)
{
  e.Cancel = true;
  Process.Start("iexplorer.exe", e.Url);
}


来源:https://stackoverflow.com/questions/6309595/click-on-a-link-event-webbrowser-c

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