读书人

在Webbrowser控件中怎么点一击个连接

发布时间: 2012-01-26 19:40:46 作者: rapoo

在Webbrowser控件中,如何点一击个连接,将参数返回VB主程序?
在Webbrowser控件中显示一个连接,点击这个连接时,将其中的内容作为参数返回VB。

<a href= "** 'TV ' is an abbreviation for [of] 'television. TV. "> <img border= "0 " src= "sound5.jpg " width= "15 " height= "11 "> </a> 'TV ' is an abbreviation for [of] 'television. <br> TV 是 television 的缩写字。

点击sound5.jpg按钮后,将“ 'TV ' is an abbreviation for [of] 'television. <br> TV 是 television 的缩写字。”作为参数返回到主程序中。

我不知道如何才能返回啊。
谢谢!

[解决办法]
我有一种方法,可以实现类似的办法吧!呵呵,不知道,是否合适你就是了!


添加
在 <a ...> 中,添加 target= "_blank "

Dim StatusText As String
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
StatusText = Text
End Sub
这个事件,首先是把连接(因为当我们鼠标移到HREF的连接上时,状态栏的状态,就会改变为连接的地址嘛!所以我们这里,所以保留下来)

之后,在
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
'这里把添出新窗体的取消了.
Call MsgBox "我点的连接是 "&StatusText
Cancel = True
End Sub

不知这样是否合适你哈!

读书人网 >VB

热点推荐