locked
Add split button in VS Toolbar RRS feed

  • Question

  • hi all,

    How can I create a ToolStripSplitButton on Work-Item-Tracking toolbar inside VS?

    I found this post that explains how to do it in VS package project: 

    http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/b50df040-6dc7-4b6c-bd6d-5b68fc7c42a5

    I want to add the split button to the Work-Item-Tracking toolbar and I cannot find its Id:

    <Group guid="guidVSPckgSpellCheckerCmdSet" id="MyMenuGroup" priority="0x0600">
            <Parent guid="guidSHLMainMenu" id="??IDM_VS_...??"/>
          </Group>

    If I use VS add-in project (instead of VS Package) I can get the toolbar object:

    CommandBar contextMenu = ((CommandBars)_applicationObject.CommandBars)["Work Item Tracking"];

    but I don't know how to add a Split button..

    So I need one of the two..

    1. How to create VS Package project that adds a split button in Work Item Taking toolbar

    2. How to add split button within a toolbar in a VS add-in project

    Thanks!!

    Roy


    R.R


    • Edited by Roy.Rosenberg Wednesday, March 7, 2012 8:48 AM spelling
    Wednesday, March 7, 2012 8:47 AM

All replies

  • VSCT (the first methd) is far preferable to DTE as it is a case of declarative vs imperative (which for UI is always better, simply stating what you want and having it done without having to run code is preferable as it means we can build the UI without needing to load your package).

    What you want is a MenuController, and the proper parent can be found using VSCTPowerToy.

    Ryan

    Wednesday, March 7, 2012 7:11 PM
  • Ryan,

    Thanks for you answer.

    I already tried the VSCTPowerToy but somehow it does not display the information of the Work item Tracking toolbar... this is the info i get:

    Package Guid: guidCurrituckPackagePkg

    guid: CommandSetGuid

    id: 0x100

    parent guid: CommandSetGuid

    id: 0x0

    I need some help here..

    Thanks. Roy


    R.R

    Friday, March 9, 2012 10:36 AM
  • It doesn't appear to be 'published' in the normal SDK headers, you can declare your own local definition of CommandSetGuid in your VSCT like so:

        <GuidSymbol name="CommandSetGuid" value="{2dc8d6bb-916c-4b80-9c52-fd8fc371acc2}">
          <IDSymbol name="WorkItemTrackingToolbarID" value="0x100"/>
        </GuidSymbol>

    Ryan

    Saturday, March 10, 2012 7:08 PM