Control name = ((Control Type)sender).Text;
Control Type :
- ToolStripMenuItem
- Button
We can get other details of the control too. Basically we could use ((Control Type)sender) as an alias to the control name.
((Control Type)sender).Text = “Controls New Text”;