how to deal with multiple linklabels

vanbeck72

New member
Joined
Mar 4, 2005
Messages
1
Location
Barranquilla (COLOMBIA)
Programming Experience
5-10
Hi y'all, vb.net gurues!
I was able to create multiple linklabels dynamically.
The problem is that every linklabel has to open a different HTML page.
This piece of code is intended to be the way to achieve that:

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal_
e As System.Windows.Forms.LinkLabelLinkClickedEventArgs
)_
Handles LinkLabel1.LinkClicked
System.Diagnostics.Process.Start("www.startvbdotnet.com")
End Sub


but it applies to one linklabel only.
How can I attach (dynamically) a linkClicked event to every linklabel?
so, the linklabel1 points to http://webserver/mypage1.html, the linklabel2 points to http://webserver/mypage2.html, and so on.

Thanx in advance.

javier.
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
make sure you've added an eventhandler for each linklabel you've created then simply make a sub to open the different html pages and use the
Handles LinkLabel1.LinkClicked
for each of the linklabels click event in the declaration line of each sub
 
Top Bottom