获取VB里 webbrowser 中的按钮事件

引用Microsoft  HTML  Object  Library 

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>
上一篇:如何解决一些控件无法运行在高版本的Chrome下运行的问题


下一篇:java.lang.reflect.MalformedParameterizedTypeException 的解决办法