A handler is created as follows:
AddHandler eventargs, AddressOf subroutine
. I.e. AddHandler TextBox1.KeyDown, AddressOf MySub
Of course, you need to have a subroutine called MySub for this example, and from here you add the code you want to do the work for that event to that subroutine (MySub). See
Adding Handlers.
How to
Pass Values to Subroutines will demonstrate how you can send values to other subroutines from your Link declaration in your For Each Loop.
Your For Loop belongs in the
Navigating EventArgs subroutine.
From there, you can check the URL that's been navigated to. (Obviously you would only be navigating if you click a link, so this is the correct sub to use).
Because the WebBrowser control raises the Navigating event when it's about to navigate to a new page and it will fire the Navigated event when it has started navigating to a new page.
Using these events will allow you to check the link that was clicked in your loop, against where you are navigating to. However, by using the navigating and navigated event args, you don't need a loop.
Hope this helps.