I have a TextBox Array
private TextBox[,] Fields = new TextBox[9, 9];
and all the TextBoxes have got the same TextChanged-Event
void Field_Changed( object sender, EventArgs e )
Is there a way to get the Index of the sender in the Array (without giving each TextBox it’s own EventHandler)?
Do you really need the index, the sender is a reference to the instance that send the request.
If the answer to 1 is yes, you can put the index in the ‘Tag’ property of the textbox and then query that.
Alternatively you can search the array for the instance that matches the
senderargument of the event.