Exemplo n.º 1
0
 private void ListViewDblClick(object sender, EventArgs e)
 {
     if (_actionEditImage.Enabled)
     {
         _actionEditImage.DoExecute();
     }
 }
        private bool ShortCutKeys(ref Message msg, Keys keyData) //@ added
        {
            bool result = false;

            if (msg.Msg == NativeMethods.WM_KEYDOWN)
            {
                switch (keyData)
                {
                //ShortcutKeys for ToolStripButton
                case (Keys.Shift | Keys.Control | Keys.Insert):
                    if (_actionAddCommand.Enabled)
                    {
                        _actionAddCommand.DoExecute();
                        result = true;
                    }
                    break;

                case (Keys.Control | Keys.F):
                    if (_actionSearchCommand.Enabled)
                    {
                        _actionSearchCommand.DoExecute();
                        result = true;
                    }
                    break;

                //Remove
                case (Keys.Control | Keys.Delete):
                    if (_actionRemoveCommand.Enabled)
                    {
                        _actionRemoveCommand.DoExecute();
                        result = true;
                    }
                    break;

                //Arrow Up
                case (Keys.Control | Keys.Up):
                    if (_actionMoveUp.Enabled)
                    {
                        _actionMoveUp.DoExecute();
                        result = true;
                    }
                    break;

                //Arrow Down
                case (Keys.Control | Keys.Down):
                    if (_actionMoveDown.Enabled)
                    {
                        _actionMoveDown.DoExecute();
                        result = true;
                    }
                    break;
                }
            }
            return(result);
        }