locked
SDK Package 2012: How do I make my other commands available in my toolbar's "Add or Remove Buttons" menu? RRS feed

  • Question

  • My extension creates a toolbar with 2 buttons.  However, my extension provides 14 commands, so I'd like to make my other 12 commands available on my toolbar's "Add or Remove Buttons" menu.  I'm trying to stick to the VS 2012 UI guidelines and minimize toolbar buttons, but I want to make it easy for users of my earlier tools to get back all the commands on the toolbar if they want.

    Unfortunately, I can't figure out any combination of CommandPlacement, CommandFlag, etc. in my VSCT file that will let me declare initially hidden toolbar buttons.  I can't find a sample extension doing this either.  But many of Visual Studio's built-in toolbars do this (e.g., Standard, XML Editor), so I know there's some way to do it.

    FWIW, the complete source code to my extension is available at http://www.menees.com/Files/MeneesVsTools2012.zip (in the embedded Menees.VsTools.SourceCode.zip) if anyone wants to look at the VSCT file or C# source code.

    Can someone tell me how to do this?  Hopefully, there's some "obvious" way that I'm overlooking.  Thanks!

    Saturday, September 8, 2012 11:26 PM

Answers

  • There is, unfortunately, no way to do this. The VS built in toolbars do it through "partial removal" records in the various profiles. This approach was taken as a minimal cost way for the folks doing the toolbar reduction work (non-developers) to do it across SKUs that all have very different default toolbar layouts. Unfortunately there is no way for individual extensions to make changes to every profile, which is what would be necessary.

    Ryan

    Sunday, September 9, 2012 4:42 AM

All replies

  • There is, unfortunately, no way to do this. The VS built in toolbars do it through "partial removal" records in the various profiles. This approach was taken as a minimal cost way for the folks doing the toolbar reduction work (non-developers) to do it across SKUs that all have very different default toolbar layouts. Unfortunately there is no way for individual extensions to make changes to every profile, which is what would be necessary.

    Ryan

    Sunday, September 9, 2012 4:42 AM
  • Good to know.  Thanks for your help, Ryan.
    Sunday, September 9, 2012 12:54 PM