Question: I have a textbox and in some cases in Enter event I need to set the focus to a different textbox.

I tried that code:

```
 private void TextBox1_Enter(object sender, EventArgs e)
 {
     if(_skipTextBox1) TextBox2.Focus();
 }

```

But this code doesn't work. After that I found on MSDN:

> 
> Do not attempt to set focus from within the Enter, GotFocus, Leave, LostFocus, Validating, or Validated event handlers.
> 
> 
> 

So how can I do it other way?

Answer: 
Postpone executing the Focus() method until after the event is finished executing. Elegantly done by using the Control.BeginInvoke() method. Like this:

```
    private void textBox2_Enter(object sender, EventArgs e) {
        this.BeginInvoke((MethodInvoker)delegate { textBox3.Focus(); });
    }

```
```
textBox.Select();

```

or

```
textBox.Focus();

```

or
`set TabIndex = 0` from properties of that `textBox`.

both methods are use to set focus on `textBox` in **C#**, **.NET**