I got in Form_Load :
for (int i = 1; i < 10; i++)
{
this.Controls["txtPrix"+i].Enter += new EventHandler(DlgFacture_Enter);
}
I got the event :
void DlgFacture_Enter(object sender, EventArgs e)
{
this.setTextBoxPrixEnter((TextBox)sender);
}
In that last event, I want to be able to print the TextBox root variable name (thus txtPrix1 to txtPrix10) as a string, depending on which one calls the event.
How can that be done ?
You mean the Name property?