src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerBranch.cs
/// <summary>
///     Handles special key bindings for key down events.  Base class handles space and tab.
/// </summary>
/// <param name="row">Index into this branch</param>
/// <param name="column">Column index</param>
/// <param name="key">Character typed by the user</param>
/// <param name="modifiers">Any modifiers keys currently held down</param>
/// <returns>ProcessKeyResult structure that indicates what action should be taken (if any)</returns>
Handles special key bindings for key down events.  Base class handles space and tab.
Handles special key bindings for key down events . Base class handles space and tab .
protected virtual ProcessKeyResult ProcessKeyDown(int row, int column, KeyEventArgs e)
        {
            var result = new ProcessKeyResult();
            result.Action = KeyAction.Process;
            result.Direction = (e.Modifiers != Keys.Shift) ? NavigationDirection.Right : NavigationDirection.Left;
            switch (e.KeyCode)
            {
                case Keys.F2:
                    result.Action = KeyAction.Handle;
                    result.StartLabelEdit = true;
                    result.Direction = NavigationDirection.Down;
                    break;
                case Keys.Tab:
                    result.Action = KeyAction.Handle;
                    result.ColumnType = null;
                    break;
                case Keys.Space:
                    if (_columns[column].ColumnIsCheckBox || InLabelEdit)
                    {
                        result.Action = KeyAction.Process;
                    }
                    break;
                case Keys.Up:
                    if (!e.Control)
                    {
                        result.Action = KeyAction.Handle;
                        result.Local = false;
                        result.Direction = NavigationDirection.Up;
                    }
                    break;
                case Keys.Down:
                    if (!e.Control)
                    {
                        result.Action = KeyAction.Handle;
                        result.Local = false;
                        result.Direction = NavigationDirection.Down;
                        if (e.Alt)
                        {
                            result.StartLabelEdit = true;
                        }
                    }
                    break;
                case Keys.Delete:
                    result.Action = KeyAction.Handle;
                    result.Delete = true;
                    break;
            }
            return result;
        }
protected virtual ProcessKeyResult ProcessKeyDown ( int row , int column , KeyEventArgs e ) { var result = new ProcessKeyResult ( ) ; result . Action = KeyAction . Process ; result . Direction = ( e . Modifiers != Keys . Shift ) ? NavigationDirection . Right : NavigationDirection . Left ; switch ( e . KeyCode ) { case Keys . F2 : result . Action = KeyAction . Handle ; result . StartLabelEdit = true ; result . Direction = NavigationDirection . Down ; break ; case Keys . Tab : result . Action = KeyAction . Handle ; result . ColumnType = null ; break ; case Keys . Space : if ( _columns [ column ] . ColumnIsCheckBox || InLabelEdit ) { result . Action = KeyAction . Process ; } break ; case Keys . Up : if ( ! e . Control ) { result . Action = KeyAction . Handle ; result . Local = false ; result . Direction = NavigationDirection . Up ; } break ; case Keys . Down : if ( ! e . Control ) { result . Action = KeyAction . Handle ; result . Local = false ; result . Direction = NavigationDirection . Down ; if ( e . Alt ) { result . StartLabelEdit = true ; } } break ; case Keys . Delete : result . Action = KeyAction . Handle ; result . Delete = true ; break ; } return result ; }
Handles special key bindings for key down events.
Handles special key bindings for key down events .
// check box and text box columns should use default  // key processing for the space bar (toggle value) // let Ctrl-Up fall through to the base control processing. // let Ctrl-Down fall through to the base control processing. // Alt + Down should open a drop down
ProcessKeyResult structure that indicates what action should be taken (if any)
ProcessKeyResult structure that indicates what action should be taken ( if any )
row
int
Index into this branch
Index into this branch
column
int
None
e
KeyEventArgs
key
Character typed by the user
Character typed by the user
modifiers
Any modifiers keys currently held down
Any modifiers keys currently held down