private void Presionar(object sender, KeyEventArgs e) { ctrl = (Control)sender; if (e.Key == Key.Enter) { if (ctrl.Name.Equals("TxtHost") && !string.IsNullOrEmpty(TxtHost.Text)) { TxtUsu.Focus(); } if (ctrl.Name.Equals("TxtUsu") && !string.IsNullOrEmpty(TxtUsu.Text)) { TxtPassMS.Focus(); } if (ctrl.Name.Equals("TxtPassMS") && !string.IsNullOrEmpty(TxtPassMS.Password)) { TxtBDMS.Focus(); } if (ctrl.Name.Equals("TxtBDMS") && !string.IsNullOrEmpty(TxtBDMS.Text)) { TxtPortMS.Focus(); } if (ctrl.Name.Equals("TxtPortMS") && !string.IsNullOrEmpty(TxtPortMS.Text)) { ButCrear.Focus(); } if (ctrl.Name.Equals("TxtNomBD") && !string.IsNullOrEmpty(TxtNomBD.Text)) { TxtPassBD.Focus(); } if (ctrl.Name.Equals("TxtPassBD") && !string.IsNullOrEmpty(TxtPassBD.Password)) { ButCrear.Focus(); } } }
private void Presionar(object sender, KeyEventArgs e) { if (e.Key == Key.Enter && !string.IsNullOrEmpty(TxtNomBD.Text)) { ButCrear.Focus(); } }