2015-09-06 48 views
4

我需要issgin CTRL + F12和CTRL + GVSIX键绑定不分配

此代码不能正常工作

<KeyBindings> 
<KeyBinding guid="guidCmdSet" id="cmdSolutionList" editor="guidVSStd97" key1="VK_F12" mod1="CONTROL" /> 
<KeyBinding guid="guidCmdSet" id="cmdCodeItemsList" editor="guidVSStd97" key1="G" mod1="CONTROL" /> 
</KeyBindings> 

但此代码的工作

<KeyBindings> 
<KeyBinding guid="guidCmdSet" id="cmdCodeItemsList" editor="guidVSStd97" key1="0" mod1="CONTROL" /> 
</KeyBindings> 

为什么不行?

如何分配CTRL + F12和CTRL + G?

回答

1

集与代码结合

Command command = SolutionList.DTE.Commands.Item("Name1", -1); 
command.Bindings = "Global::Ctrl+F12"; 
command = SolutionList.DTE.Commands.Item("Name2", -1); 
command.Bindings = "Global::Ctrl+G";