Control array with 1 DoubleClick event handler, how to determine which control initiated event?

Mar 30 2010 4:38 PM

I have a screen with an array of labels (coded as:  label[]  aLabel = new label[30];
I would like to write a single DoubleClick event that handles all Double Click events for the array but action taken would be unique for the aLabel[] clicked. Therefore I have to determine which aLabel was DoubleClicked - there in lies the problem. There seems to be no way of determining the index value of the aLabel initiating the event. the sender data (in the event handler) can be viewed when in debug mode in VS2008 but there is no way of access this data withou knowning which indexed aLabel was clicked.
Any ideas??? this is driving me crazy and I'd hate to have to create 31 event handles, one for each indexed aLabel.

Answers (6)