for (int i = 0; i < 64; i++)
{
//set some properties
PicBoxList[i].MouseDown += new MouseEventHandler(PicBox_MouseDown);
}
void PicBox_MouseDown(object sender, MouseEventArgs e)
{
//in here I need to reference PicBoxList[i], so I need to pass the picturebox itself, or the //array and index in here somehow
}
I've been reading a lot about delegates and such, but it's a little confusing and I'm not sure if I need a delegate here because from what I understand, they are for using multiple methods for the same eventhandler? Is there a simpler way to add an argument to an event handler?
Thanks for help!

New Topic/Question
Reply




MultiQuote




|