private void TxtBoxGen_PreviewKeyDown(object sender, KeyEventArgs e) { try { if (e.Key == Key.Up) { e.Handled = true; TxtBoxRegion.Focus(); } else if (e.Key == Key.Down) { e.Handled = true; TxtBoxName.Focus(); } else if (e.Key == Key.Enter) { e.Handled = true; ButtonAdd.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent)); } } catch (Exception) { LabelMessage.Content = "Error during keyboard navigation."; } }
private void BtnEnable_Click(object sender, System.EventArgs e) { groupBox1.Enabled = true; TxtBoxName.Focus(); }
public RegisterWindow() { InitializeComponent(); TxtBoxName.Focus(); }