private void LoginForm_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) OKbutton_Click(null, null); }