ATMLCommonLibrary.controls.awb.ScrollBox.ProcessKey C# (CSharp) Method

ProcessKey() private method

private ProcessKey ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void
        private void ProcessKey(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
            {
                if (e.KeyCode == Keys.Up)
                {
                    _currentIndex--;
                }
                else if (e.KeyCode == Keys.Down)
                {
                    _currentIndex++;
                }
                _currentIndex = _currentIndex < 0 ? 0 : _currentIndex;
                _currentIndex = _currentIndex >= _values.Count ? _values.Count - 1 : _currentIndex;
                edtValue.Text = _values[_currentIndex];
            }
            else if (e.KeyCode == Keys.Delete)
            {
                _currentIndex = -1;
                edtValue.Text = "";
            }

            btnDrop.Invalidate();
            Update();
        }