I have a winforms sign in in c# that I would like to have it try login after pressing the enter key on the password box.
I have a username textbox, password textbox, and a label for my submit.
I have this for my enter keypress.
private void password_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
signinbutton.Click(); //I was thinking something like this would work
}
}
Any ideas would be appreciated thanks.
I presume your code currently looks like this:
Here is what I recommend you do: