In a C# project I have an array of PictureBoxes.
I form an event handler for each picturebox as it is created using i as an
index.
PictureBox1[i].Click += new System.EventHan dler(ClickHandl er);
In the event handler I would like to determine the index of the clicked box.
The code below does not return the index.
public void ClickHandler(Ob ject sender, System.EventArg s e)
{
textBox1.Text = sender.ToString ();
}
Any help would be appreciated.
Thanks,
Jim
I form an event handler for each picturebox as it is created using i as an
index.
PictureBox1[i].Click += new System.EventHan dler(ClickHandl er);
In the event handler I would like to determine the index of the clicked box.
The code below does not return the index.
public void ClickHandler(Ob ject sender, System.EventArg s e)
{
textBox1.Text = sender.ToString ();
}
Any help would be appreciated.
Thanks,
Jim
Comment