如何向 Visual Studio 添加自定义命令?
我经常使用一个外部命令 - 基本上是启动一个批处理文件。我想在 IDE 中添加一个工具栏按钮(可能还有键盘快捷键)。有没有简单的方法可以做到这一点?
There's an external command I'm using constantly - basically launching a batch file. I'd like to put a toolbar button (and possibly keyboard shortcut) for this into the IDE. Is there an easy way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,通过选择“工具”、“外部工具”并填写对话框,向“工具”菜单添加一个项目,如下所示:
调出工具自定义,点击底部的键盘按钮,找到合适的外部工具编号:
First, add an item to your Tools menu by choosing Tools, External Tools, and filling out the dialog, like this:
Then bring up Tools Customize, click the Keyboard button at the bottom, and find the appropriate external tool number:
VS 中配置的所有外部命令都可以通过“工具”>“自定义”菜单添加到工具栏或菜单中,作为“外部命令##”。您只需要知道哪个数字对应于您配置的特定命令。我相信它是按照外部命令列表中的条目顺序排列的。
同样,您可以在“选项”>“环境”>“键盘”的命令列表中找到这些名称,并以这种方式为您的命令分配快捷方式。
All the configured external commands in VS are available to add to a Toolbar or Menu through the Tools>Customize menu as "External Command ##". You just need to know which number corresponds to the particular command you've configured. I believe it is in order of entry in the external commands list.
Similarly, you can find those names in the commands list in Options>Environment>Keyboard and assign a shortcut to your command that way.