Visual Studio扩展开发——菜单与工具栏中的信息共享

(1)VisualStudio扩展程序开发过程中,当为一个命令设置了菜单和工具栏的时候,虽然Menu的Button和工具栏的Button中都设置了显示文字信息和Icon信息,但实际上,在工具栏的Button中设置的这些信息都是无效的,也就是说,工具栏显示时,其Icon或ButtonText依然会采用Menu中的Button设置的内容。

 

    <Buttons>

    <!--Menu中按钮-->

       <Button guid="guidFirstCommandPackageCmdSet1id="cmdidAddNotifyPropertyChangedCommandpriority="0x0100type="Button">

       <Parent guid="guidFirstCommandPackageCmdSetid="MyMenuGroup_Notify" />

       <Icon guid="guidImages1" id="bmpPic1" />

       <Strings>

         <ButtonText>NotifyProperty</ButtonText>

       </Strings>

     </Button>

      <!--ToolBar中按钮-->

      <Button guid="guidFirstCommandPackageCmdSet1"id="cmdidAddNotifyPropertyChangedCommandpriority="0x0100type="Button">

       <Parent guid="guidFirstCommandPackageCmdSetid="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。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值