Events being called as many times as pages loaded
I have a strange issue now. If I load one page, I can capture event such as a click or a an onkeydown. Only 1 event is fired. But, if I load one page after another (I am calling Me.AxWebBrowser1.Navigate2(strUrl) where strUrl is the url to load a new page), the new document loads, but now all of my events are doubled. So, if i capture the onclick event, it acts as if it is clicking on the new document and the old document. If I load 10 pages, I get 10 events. It is as if I need to dispose of the first document before I load a new one. But, I have tried a number of things and cannot get the original document to be gone so I only have 1 event. Is Navigate2 the wrong function to load a document? I have tried Navigate.
vsdotnet or other
To see an example of this, add "AxWebBrowser1.GoHome()" to the onclick event of the sample vsdotnet posted. You will see now the listbox starts to exponentially add more items.
Gotta love this stuff. I am sure there is an easy solution, but not easy for me I guess.
Thanks in advance.