Dotneteers.net
All for .net, .net for all!

VS 2010 Beta1 Issues #1: “TextOnly” Command flag does not work

Upgrading my samples from VS 2008 to VS 2010 for the forthcoming book helps me finding issues in VS 2010 Beta1. The freshest one I have caught is related to the TextOnly command flag in the .vsct file of VSPackages. The TextOnly command flag is assumed to set up the visual properties of a menu item so that the related icon is not displayed, only the label of the item. It seems that it does not work for menu items in VS 2010 Beta1.

To reproduce the behavior, create a new VSPackage with VS 2010 Beta1 and follow the following screenshots to set up the project:

 

 

The wizard creates a simple menu command for you which is displayed in the Tools menu:

The .vsct file contains the following definition for the Button element defining the menu item:

<Button guid="guidTextOnlyFlagBugCmdSet" id="cmdidMyCommand" priority="0x0100"

  type="Button">

  <Parent guid="guidTextOnlyFlagBugCmdSet" id="MyMenuGroup" />

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

  <Strings>

    <CommandName>cmdidMyCommand</CommandName>

    <ButtonText>My Simple Command</ButtonText>

  </Strings>

</Button>

Now, add the TextOnly command flag to the Button definition:

<Button guid="guidTextOnlyFlagBugCmdSet" id="cmdidMyCommand" priority="0x0100"

  type="Button">

  <Parent guid="guidTextOnlyFlagBugCmdSet" id="MyMenuGroup" />

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

  <CommandFlag>TextOnly</CommandFlag>

  <Strings>

    <CommandName>cmdidMyCommand</CommandName>

    <ButtonText>My Simple Command</ButtonText>

  </Strings>

</Button>

The menu item is expected to hide its icon—it works this way in VS 2008—but it shows up after rebuilding and running your VSPackage project:

The icon marked with the thick red border should not be visible… This is not a big issue, but before trying what you have done wrong with your VSCT file, it is better to know that this is a bug. I hope, it won’t be there in the Beta 2 version of Visual Studio 2010.

The nice thing is, that this command flag works as expected with toolbar items.


Posted Jul 04 2009, 03:47 PM by inovak
Filed under: , ,

Comments

cax wrote re: VS 2010 Beta1 Issues #1: “TextOnly” Command flag does not work
on Fri, Oct 12 2012 9:45

are you sure ? I tried in VS2010 SP1 and SDK SP1 and it works fine. The only thing differ from your tutorial is <CommandFlag> element must be placed after <Icon> element, otherwise it is error.

Note : make sure you reset vs2010 experimental instance, by VS2010SDK -> Tools -> Reset.....

Topsoil wrote re: VS 2010 Beta1 Issues #1: “TextOnly” Command flag does not work
on Sat, Feb 16 2013 12:12

Very informative post.Much thanks again.