You don't need to worry about array indices etc... all events comes with a standard pair of arguments - "sender" and "e", for example
sender is a reference to whatever object raised the event, so you can just use "sender" to manipulate the picture box directly (you will probably want to cast from type object to picturebox first though.Code:Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown End Sub
Here's an example :
Code:Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Dim MyPb As PictureBox = CType(sender, PictureBox) MyPb.Visible = False End Sub




Reply With Quote
