注册 登录
编程论坛 VB.NET论坛

vb方法能转化为vb.net方法吗?

zsdqxzxx 发布于 2017-12-15 22:08, 2076 次点击

必须引用Microsoft html object library
单击command1获得框架及其元素方法1
Private Sub Command1_Click()
Dim Doc2 As HTMLDocument
Dim Web2 As WebBrowser_V1
 Set Web2 = GetFrameIframeLikeUrl(WebBrowser1.Document, "*baidu.com*")
If Not Web2 Is Nothing Then
    Set Doc2 = Web2.Document
   Doc2.getElementById("JZGXXJLXX_addBtn").Click,单击了网页框架中的按钮
End If
End Sub


Function GetFrameIframeLikeUrl(Vdoc As HTMLDocument, LikeUrl As String) As WebBrowser_V1

Dim Vtag, Tname As String, FrameWeb As WebBrowser_V1
For Each Vtag In Vdoc.All
        Tname = Vtag.tagName
        If Tname = "IFRAME" Or Tname = "FRAME" Then
            Set FrameWeb = Vtag
              If FrameWeb.LocationURL Like LikeUrl Then
 
                  Set GetFrameIframeLikeUrl = FrameWeb
                  Exit Function
             End If
        End If
Next
End Function


不知在中怎么实现。上述代码能转化为代码吗?期待高手。
2 回复
#2
zsdqxzxx2018-01-15 17:17
求高手
#3
zgtjnhxglhj2018-01-29 19:26
网络很多例子你找例子也得一步一步的不是一下到底
1