How to change the Caption of the Command on the toolbar from a Macro in VS2010?
问题 From a macro I am accessing a command that is on the toolbar: Dim name As String = "Macros.MyMacros.MyMacros.ToggleExceptions" Dim cmd As EnvDTE.Command = DTE.Commands.Item(name) How do I now change the caption of the command on the toolbar? It does not seem to have the necessary properties. Do I need to cast it to something else? 回答1: I've implemented it: Private Sub Main() Const BAR_NAME As String = "MenuBar" Const CTL_NAME = "Foo" ChangeCommandCaption(BAR_NAME, CTL_NAME, "Bar") End Sub