I hope the name gives justice to my question... So, I just started making a memory game, and there are 25 checkbox buttons which I am using to show the items.
I was wondering whether there was a way to tell from either the EventArgs or the Object what button it was sent from if each button used the same event handler.
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
checkBox = Code which will determine what checkBox sent it.
if (checkBox.Checked)
{ Box.ChangeState(checkBox, true); }
else { Box.ChangeState(checkBox, false);}
}
sender
is, the thing that triggers the event. – SchoolroomEventArgs
and pass it as a parameter instead, you could define the name of the method in there. But so far I haven't found a way to overwrite the standard signature. – Countersubject