如何在WebBrowser控件中超链接到图像 [英] How do i hyperlink to image in WebBrowser control

查看:104
本文介绍了如何在WebBrowser控件中超链接到图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想要超链接到WebBrowser控件中的图像,但以下代码有问题:-webBrowser1.Document.Images [0] .Document.ExecCommand("CreateLink",false,url);
谁能帮我.

在此先感谢.

Hello,

I want hyperlink to a image in WebBrowser control ,but having problem to do by following code:- webBrowser1.Document.Images[0].Document.ExecCommand("CreateLink", false, url);
Can anyone please help me.

Thanks in Advance.

推荐答案



您可以使用以下代码进行此操作

对于Windows应用程序


u can do this using following code

For Windows Application
webBrowser1.Url = new Uri("http://www.codeproject.com");


对于Web应用程序


For Web Application

<a href="http://www.espn.com" target="_blank">
 <img src="ahman.gif" />
</a>


希望对您有帮助
快乐编码:)
祝您好运


Hope it helps u
Happy Coding :)
Best Luck


我假设您正在使用Windows窗体,并且想导航到链接上的其他页面.

如果是这样,那么这应该可以帮助您入门.

导航 [
I assume that you are using windows forms, and want to navigate to other pages on links.

if so, then this should get you started.

Navigation[^]




请检查
在新标签页的网络浏览器控件中打开链接链接.

这可能对您有帮助,

-Amit
Hi,

Please check Open link in new tab webbrowser control link.

this may help you,

-Amit


这篇关于如何在WebBrowser控件中超链接到图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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