Project/02 - Engine/LittleBigTools/UserControls/NumericUpDownTextBox.xaml.cs
/// <summary>
/// Checks if the keypress is the up or down key, and then handles keyboard input
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
Checks if the keypress is the up or down key, and then handles keyboard input
Checks if the keypress is the up or down key and then handles keyboard input
private void control_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Down)
            {
                HandleModifiers(-1);
                e.Handled = true;
            }
            else if (e.Key == Key.Up)
            {
                HandleModifiers(1);
                e.Handled = true;
            }
            else if (e.Key == Key.Space)
                e.Handled = true;
            else
                e.Handled = false;
        }
private void control_PreviewKeyDown ( object sender , KeyEventArgs e ) { if ( e . Key == Key . Down ) { HandleModifiers ( - 1 ) ; e . Handled = true ; } else if ( e . Key == Key . Up ) { HandleModifiers ( 1 ) ; e . Handled = true ; } else if ( e . Key == Key . Space ) e . Handled = true ; else e . Handled = false ; }
Checks if the keypress is the up or down key, and then handles keyboard input
Checks if the keypress is the up or down key and then handles keyboard input
// Space key is not caught by PreviewTextInput
sender
object
None
e
KeyEventArgs
None