Question: I`m not able to find answer. 
I have several text boxes and if user enters/leaves them I check if he has changed something and the code below works.

```
private void txtRegNazov_Enter(object sender, EventArgs e)
{
    if (txtRegNazov.Text == "n/a")
    {txtRegNazov.Text = "";}
}

private void txtRegNazov_Leave(object sender, EventArgs e)
{
    if (txtRegNazov.Text == "")
    {txtRegNazov.Text = "n/a";}
}

```

I would like to create a function like

```
public void ClearFieldDataByEnter() 
{
  thisHlep.text = "";
}

public void FieldDataByleave() 
{
  thisHelp.text = "n/a";
}

```

And then in every field event would be something like:

```
private void txtRegNazov_Enter(object sender, EventArgs e)
{
   thisHelp.Name = name of this txtBox; 
   ClearFieldDataByEnter();
}

```

This is only an easy example of what I want 
... I am looking for principe ... and I`m still new to C#.

Thank you

Answer: 
Rember that the "sender", in this case, is the actual TextBox.

```
TextBox txtSender = (TextBox)sender;

```
You can use the `sender` parameter, like this: 

```
private void txtRegNazov_Enter(object sender, EventArgs e)
{
    ClearFieldDataByEnter(sender);
}

private void txtRegNazov_Leave(object sender, EventArgs e)
{
    FieldDataByleave(sender);
}

public void ClearFieldDataByEnter(object text) 
{ 
    textBox = text as TextBox;
    if (textbox == null)
       return;
    if (textbox.Text == "n/a")
    {
         textbox.Text = String.Empty;
    }
}

public void FieldDataByleave(object text) 
{
    textBox = text as TextBox;
    if (textbox == null)
       return;
    if (String.IsNullOrEmpty(textbox.Text))
    {
       textbox.Text = "n/a";
    }
}

```