Find control name from Object Sender

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”;

Leave a Reply

You must be logged in to post a comment.