private void TXTLICDNI_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar == (int)Keys.Enter) { String resultado = TP.DEV_PERSONAL_SEGUN_TRANSPORTE_X_LIC(TXTLICDNI.Text, Convert.ToInt32(comboBox2.SelectedValue)); if (resultado.Equals("NO ENCONTRADO")) { TXTLICDNI.Focus(); } else if (TXTLICDNI.Text == "") { MessageBox.Show(this, "NECESITA INDICAR EL DNI O LICENCIA", VariablesGlobales.Titulo, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { String[] separados = resultado.Split('|'); lblcodpers.Text = separados[0]; TXTLICDNI.Text = separados[3]; TXTNOMBRE.Text = separados[2]; comboBox3.Text = separados[1]; TXTNOMBRE.Focus(); } } }
private void TXTOBSER_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar == (int)Keys.Enter) { TXTLICDNI.Focus(); } }