0

I've been trying run a procedure from the clicks in the webbrowser in vb6. I would like to know if it is possible.

I am trying to do this:

WebBrowser1.Document.Write "<a href=""#"" onClick=""CopyToTextBox(""Hello World"")"">Hello World</a>"

Private Sub CopyToTextBox(ByVal msg as String)
    TextBox1.Text = msg
End Sub

If not, is there any other way to do this?

Any help is appreciated. Thank you.

magneto
  • 97
  • 6
  • your quotes nesting is wrong, beside this here is the solution: [Show VB6 forms when click a link in html page of webbrowser](https://stackoverflow.com/questions/45475610/show-vb6-forms-when-click-a-link-in-html-page-of-webbrowser/45482206#45482206) – deblocker Aug 18 '17 at 12:49
  • 1
    There is no direct way to call a vb function within html code inside webbrowser. A workaround as suggested is, given an anchor link for the required element and when it is clicked, beforenavigate event is triggered. here you can do whatever you want by checking the the link. make sure you use "Cancel = True" for these links that need not be navigated, so no navigation occurs – Shafeek Aug 19 '17 at 14:59
  • indeed. in my case, it was required and that was what I did. but thanks for your reply @AbuZiyad – magneto Aug 19 '17 at 15:40

0 Answers0