I am trying to get id or name of for example checkbox from event in a windows form application in c#. Is it possible ?
Thank you..
private void aktifMWcheckBox_CheckedChanged(object sender, EventArgs e)
{
string cbname = sender.Name; // is it possible something like that ???
}
Yes, for controls’ events you can always cast
sendertoControl(because every control inherits from it):Also, if you are sure that is for example a
CheckBoxevent, you can cast to it: