Show VB6 forms when click a link in html page of webbrowser

前端 未结 3 1714
终归单人心
终归单人心 2021-01-21 08:56

I am working with VB6 WebBrowser, Here i need to open a vb6 form when user click any particular link of WebBrowser\'s link like

In HTML

3条回答
  •  攒了一身酷
    2021-01-21 09:33

    To do this with a button instead of a link, add the button to the document and a bit of javascript:

    
    
    
    

    Then in the BeforeNavigate2 event:

    Public Sub webBrowser_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    
      Select Case LCase$(URL)
        Case "event:button1_show"
          Cancel = True
          Form2.Show
        Case "event:other_stuff"
          'other stuff to do, etc
      End Select
    End Sub
    

提交回复
热议问题