something like this
vb Code:
Private Sub PictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click, PictureBox2.Click, PictureBox3.Click For index As Integer = 0 To FlowLayoutPanel1.Controls.Count - 1 If TypeOf FlowLayoutPanel1.Controls(index) Is PictureBox Then If sender.Name = FlowLayoutPanel1.Controls(index).Name Then MessageBox.Show(index) End If End If Next End Sub
the typeof line is actually unnecessary in this case, but i like it there![]()




Reply With Quote