Paste the object sender
(your text box in which the event occurred) on the TextBox
.
If you need only one property, write
string propertyName = ((TextBox)sender).Name;
But when more than one property is required, it is better to create a Textbox variable and use it as.
TextBox txtbox = (TextBox)sender;
Then you can use any property like
string propertyName = txtbox.Name; MessageBox.Show(proptertyName); MessageBox.Show(txtbox.Content.ToString());
source share