Delete Key is not supported for Project FileNode and FolderNodes


  Pressing Del key when the focus is in FileNode/FolderNode at Solution Explorer shall remove the selected item from the project and delete the item from physical disk.
Modifications done to MPF source to accomplish the above behavior:
Uncomment the following line in the QueryStatusOnNode override of FileNode
//case VsCommands.Delete: goto case VsCommands.OpenWith;
Note: IVsHierarchyDeleteHandler is implemented in HierarchyNode
Added the following piece of code in ExecCommandOnNode implementation of FileNode.cs
if(cmdGroup == VsMenus.guidStandardCommandSet97)
     case VsCommands.Delete:
            MessageBox.Show("Del Key Pressed");
            return VsConstants.S_OK;
After building the solution, I can see the delete context menu with 'Del' key bonded with the Delete command [possibly cmdiddelete] when i right click the filenode. But pressing the Del key doesn't show the message box.
Expected result:
  If Del key is pressed when the focus is at FileNode of Solution Explorer, the message "Del Key Pressed" should popup.
Actual result:
 The message box "Del key pressed" is not poped up. 
It seems like del key binding has some issues with MPF with respect to FileNode and FolderNode.
Following are some of the support threads raised in vsx forum,


lesta wrote Apr 11, 2011 at 9:28 AM

Simply add in the constructor of your ProjectNode derived class:
this.CanProjectDeleteItems = true;

tsgd84 wrote Apr 14, 2011 at 9:48 AM

Yes, that works!!

wrote Feb 14, 2013 at 3:58 AM