-
Private WithEvents m_oDoc As HTMLDocument Dim oEvent As CEventObj Private Sub Command1_Click() End Sub Private Sub Form_Load() WebBrowser1.Navigate "http://localhost:82/index.asp" End Sub Private Function m_oDoc_onclick() As Boolean Set oEvent = m_oDoc.parentWindow.event If oEvent.srcElement.id = "login" Then Form2.Show Form2.WebBrowser1.Navigate "http://localhost:82/receive.asp" End If End Function Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) Set m_oDoc = pDisp.Document End Sub
index.asp
-
<form> <input type='button' value="登陆" id="login"></input> </form>