src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerInPlaceEdit.cs
/// <summary>
///     Forward certain key combinations directly to the text box (e.g. Ctrl-Z)
/// </summary>
Forward certain key combinations directly to the text box
Forward certain key combinations directly to the text box
[SecuritySafeCritical]
        [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
        [SecurityPermission(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData & Keys.KeyCode)
            {
                case Keys.Z: 
                    if (((keyData & Keys.Control) != 0)
                        && ((keyData & Keys.Shift) == 0)
                        && ((keyData & Keys.Alt) == 0))
                    {
                        Undo();
                        return true;
                    }
                    break;
                case Keys.A: 
                    if (((keyData & Keys.Control) != 0)
                        && ((keyData & Keys.Shift) == 0)
                        && ((keyData & Keys.Alt) == 0))
                    {
                        SelectAll();
                        return true;
                    }
                    break;
                case Keys.Delete:
                    NativeMethods.SendMessage(Handle, msg.Msg, msg.WParam.ToInt32(), msg.LParam.ToInt32());
                    return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }
[ SecuritySafeCritical ] [ SecurityPermission ( SecurityAction . Demand , Flags = SecurityPermissionFlag . UnmanagedCode ) ] [ SecurityPermission ( SecurityAction . InheritanceDemand , Flags = SecurityPermissionFlag . UnmanagedCode ) ] protected override bool ProcessCmdKey ( ref Message msg , Keys keyData ) { switch ( keyData & Keys . KeyCode ) { case Keys . Z : if ( ( ( keyData & Keys . Control ) != 0 ) && ( ( keyData & Keys . Shift ) == 0 ) && ( ( keyData & Keys . Alt ) == 0 ) ) { Undo ( ) ; return true ; } break ; case Keys . A : if ( ( ( keyData & Keys . Control ) != 0 ) && ( ( keyData & Keys . Shift ) == 0 ) && ( ( keyData & Keys . Alt ) == 0 ) ) { SelectAll ( ) ; return true ; } break ; case Keys . Delete : NativeMethods . SendMessage ( Handle , msg . Msg , msg . WParam . ToInt32 ( ) , msg . LParam . ToInt32 ( ) ) ; return true ; } return base . ProcessCmdKey ( ref msg , keyData ) ; }
Forward certain key combinations directly to the text box (e.g.
Forward certain key combinations directly to the text box ( e . g .
// ensure that the edit control handles undo. // ensure that the edit control handles select all.
Message
ref
keyData
Keys