Using VB.Net VS 2003
I am just getting into public subs and how they work. I have some code where a user has created an image on the tab of a form - Form2. I am trying to put an event handler behind the image for when it is clicked so it will pass the Image.Tag value to a textbox on Form13.
Here is what I have thus far:
Dim tabAttImg As New PictureBox
tabAttImg.Image = clsGlobals.Form2.ImageList1.Images(0)
tabAttImg.Name = "pic" & txtName.Text
tabAttImg.Tag = txtName.Text
tabAttImg.Cursor = System.Windows.Forms.Cursors.Hand
tabAttImg.Size = New Size(16, 16)
tabAttImg.Location = New Point(208, 8 + (TabbyCt * 24))
AddHandler tabAttImg.Click, AddressOf ListClickster(ByVal sender As System.Object, ByVal e As System.EventArgs) 'this line does not work the ByVal text is causing an error - says expression required
'this is the code I want put in a click event behind the image created above. How do I do this?
Public Sub ListClickster(ByVal ctrl As Control)
If clsGlobals.Form13 Is Nothing Then
clsGlobals.Form13 = New Form13
clsGlobals.Form13.lblTarget.Text = "Target Attribute: " & ctrl.Tag