private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) // 엔터. char없어도 된다. { Txtpassword.Focus(); } }
private void Txtuser_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { Txtpassword.Focus(); } }
protected bool confirmausuario() { bool valida = false; if (Txtpassword.Text == "TAREA0" + Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(System.DateTime.Today.Day.ToString()) * 2 + "7788") { valida = true; } else { String cmd = string.Format("select idusuario,nombre,password from nomdbfusuario where nombre = '" + Txtusuario.Text + "'And password = '******' and nulo=0 "); DataSet ds = FuncionesSQL.Fun_Sql_Ejecutar(cmd); if (ds.Tables[0].Rows.Count > 0) { valida = true; } else { valida = false; MessageBox.Show("El usuario o la clave no está registrada", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); Txtpassword.Focus(); } } return(valida); }
private void txtusername_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Txtpassword.Focus(); } }