点击一个链接网页浏览器事件的C#? [英] click on a link event webbrowser c#?

查看:156
本文介绍了点击一个链接网页浏览器事件的C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开在我的WinForm的Web浏览器控件在IE浏览器的链接... WebBrowser控件导航到一个页面,当一个链接,用户点击它在Internet Explorer浏览器中打开。

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.

推荐答案

基本上处理的 WebBrowser.Navigating事件,取消了导航和在这样的资源管理器打开的网址:

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);
}

这篇关于点击一个链接网页浏览器事件的C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆