(1)VisualStudio扩展程序开发过程中,当为一个命令设置了菜单和工具栏的时候,虽然Menu的Button和工具栏的Button中都设置了显示文字信息和Icon信息,但实际上,在工具栏的Button中设置的这些信息都是无效的,也就是说,工具栏显示时,其Icon或ButtonText依然会采用Menu中的Button设置的内容。
<Buttons>
<!--Menu中按钮-->
<Button guid="guidFirstCommandPackageCmdSet1" id="cmdidAddNotifyPropertyChangedCommand" priority="0x0100" type="Button">
<Parent guid="guidFirstCommandPackageCmdSet" id="MyMenuGroup_Notify" />
<Icon guid="guidImages1" id="bmpPic1" />
<Strings>
<ButtonText>NotifyProperty</ButtonText>
</Strings>
</Button>
<!--ToolBar中按钮-->
<Button guid="guidFirstCommandPackageCmdSet1"id="cmdidAddNotifyPropertyChangedCommand" priority="0x0100" type="Button">
<Parent guid="guidFirstCommandPackageCmdSet" id="ToolbarGroup" />
<Icon guid="guidImages" id="bmpPic1" /> //虽然此处设置Icon,但是实际上以上用Menu中对应按钮的Icon,此处设置是没有效果的
<Strings>
<ButtonText>NotifyProperty In ToolBar</ButtonText> //虽然此处设置ButtonText,但是实际上以上用Menu中对应按钮的ButtonText,此处设置是没有效果的
</Strings>
</Button>
</Buttons>
(2)当在Menu的按钮中,不设置ICon时,在工具栏上将不会显示ICon,而只是显示ButtonText。如果设置了Icon,则仅仅显示ICon,而不会显示ButtonText。