How to remove the focus from a TextBox in WinForms?

Focusing on the label didn't work for me, doing something like label1.Focus() right? the textbox still has focus when loading the form, however trying Velociraptors answer, worked for me, setting the Form's Active control to the label like this:

private void Form1_Load(object sender, EventArgs e)  
{ 
    this.ActiveControl = label1;       
}

You need some other focusable control to move the focus to.

Note that you can set the Focus to a Label. You might want to consider where you want the [Tab] key to take it next.

Also note that you cannot set it to the Form. Container controls like Form and Panel will pass the Focus on to their first child control. Which could be the TextBox you wanted it to move away from.


You can add the following code:

this.ActiveControl = null;  //this = form

You can also set the forms activecontrol property to null like

ActiveControl = null;