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

来源:互联网 发布:xmind 8 mac 注册码 编辑:程序博客网 时间:2024/06/05 19:51

(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。
阅读全文
0 0
原创粉丝点击