我为 Visual Studio 编写了简单的插件。该加载项包含两个命令:
command1 = commands.AddNamedCommand2(_addInInstance, "AAAA", "AAAA", "Executes the command for MyAddin2" ,true, 59, ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled, (int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);
command2 = commands.AddNamedCommand2(_addInInstance, "BBBB", "BBBB", "Executes the command for MyAddin2", true, 59, ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported, (int)vsCommandStyle.vsCommandStyleText, vsCommandControlType.vsCommandControlTypeButton);
当我运行加载项时,这两个按钮出现在 Visual Studio 的“工具”选项卡下。我希望它们出现在标准工具栏中。手动,我可以通过工具 -> 自定义 -> 命令选项卡 -> 添加命令 -> 选择插件然后选择我的两个按钮来做到这一点。我可以以编程方式进行吗?任何帮助将不胜感激。