private void Ventana_Loaded(object sender, RoutedEventArgs e) { // Ponemos el foco en el inicio. if (TbInicio.Text != "") { TbLinea.Focus(); } else { TbInicio.Focus(); } }
private void Tb_KeyDown(object sender, KeyEventArgs e) { // Si pulsamos Enter, actuamos, según sea el textbox que ha producido el evento. if (e.Key == Key.Enter) { TextBox tb = (TextBox)sender; if (tb == TbInicio) { TbLinea.Focus(); e.Handled = true; } } }