private void txt_cod_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (txt_cod.Text == "") { MessageBox.Show("Ingrese el codigo de reniec"); } else { try { if (this.txt_dni.Text.Length != 8) { MessageBox.Show("El DNI tienen mas de '8 DIGITOS'"); this.Close(); } myInfo.GetInfo(this.txt_dni.Text, this.txt_cod.Text); CaptionResul(); txt_tel.Focus(); //CargarImagen(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }