In Windows form to set the focus on the login button (as per your scenario), to set focus to a specific button on form load, you can use the ActiveControl property.
private void Form1_Load(object sender, EventArgs e)
{
this.ActiveControl = loginButton;
}
The second option is, under form properties the 'AcceptButton' property can be set to the loginButton in the designer.