Webbrowser1 document.click +vs2005

Hi,
I have been trying for a few days to get a click event to work on my htmldocument but with no luck. Looked at many examples on the net but no help there. I can get it to work in C# but not VB.

This is the code I have at present

Dim docAs HtmlDocument
doc = WebBrowser1.Document
AddHandler doc.Click,AddressOf doc_click

That is as far as I have got. I don't know how to handle the click event. Do I need to make a sub to handle that or what?

Ok I've just worked it out but I'll post anyway because it annoyed me so much that it might help other people

PrivateSub doc_click(ByVal senderAsObject,ByVal eAs HtmlElementEventArgs)

'Do something here!

EndSub

[1512 byte] By [Levyuk] at [2007-12-16]
# 1

I'm glad you got that working. Thanks for posting the solution.

BenWillett at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...