you need to use addhandler to specify a handler.
try this. it adds a picturebox to your form each time you click the button.
pictureboxes_click handles the click event of your dynamic pictureboxes.
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Static index As Integer = 0
Dim pb As New PictureBox
pb.BackColor = Color.Red
pb.Left = pb.Width * index
pb.Tag = index
index += 1
Me.Controls.Add(pb)
AddHandler pb.Click, AddressOf pictureboxes_click
End Sub
Private Sub pictureboxes_click(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox(DirectCast(sender, PictureBox).Tag)
End Sub