6
Answers

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

Ramon Liverance

Ramon Liverance

14y
3.5k
1

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)