Multiple commands on Keyboard Shortcut in Visual Studio

偶尔善良 提交于 2019-12-24 10:57:16

问题


Is it possible to have multiple commands on same Keyboard Shortcut in Visual studio?

like clicking F7 caused two different commands at the same time, instead of only 1 command.


回答1:


You can create a Visual Commander command that calls multiple VS commands and assign a shortcut to it, like this:

public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
{
    DTE.ExecuteCommand("Edit.Copy");
    DTE.ExecuteCommand("Edit.Paste");
}


来源:https://stackoverflow.com/questions/55101593/multiple-commands-on-keyboard-shortcut-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!