Geeks With Blogs
Mark Ritchie

While the commands.vsct is an improvement over 2005's ctc files, it still leaves a lot to be desired; how about a simple designer or editor for it guys!!!!

My most recent struggle has been trying to get a sub-menu to appear, a very common thing to want to do so why is there a dearth of information on the topic?

Thanks to a some help from Wesley Yao on Visual Studio Extensibility Forum I found

the solution.

Here are the key elements from my Commands.vsct file to get the sub-menu working:

<Menu guid="guidConvertCommandsCmdSet" id="ConvertSubMenu" priority="0x100" type="Menu">

    <Parent guid="guidCmdSet" id="grpidContextMain" />



        <CommandName>Convert To</CommandName>

        <ButtonText>Convert To</ButtonText>




<!-- Buttons for sub-menu Convert Items -->

<Button guid="guidConvertCommandsCmdSet" id="ConvertToSimplePropertyCommand" priority="0x0201" type="Button">

    <Parent guid="guidConvertCommandsCmdSet" id="ConvertToSubMenuGroup" />



        <ToolTipText>Convert to a simple property.</ToolTipText>




<!-- Logical group for holding the submenus of the top level menu -->

<Group guid="guidConvertCommandsCmdSet" id="TopLevelMenuGroup" priority="0x0000">

    <Parent guid="guidCmdSet" id="grpidContextMain"/>


<!-- Logical group for holding items in the "Convert To" submenus -->

<Group guid="guidConvertCommandsCmdSet" id="ConvertToSubMenuGroup" priority="0x0000">

    <Parent guid="guidConvertCommandsCmdSet" id="ConvertSubMenu"/>



<GuidSymbol name="guidConvertCommandsCmdSet" value="{Put you own GUID here}" >


    <IDSymbol name="ConvertSubMenu" value="0x1100"/>


    <IDSymbol name="TopLevelMenuGroup" value="0x1150"/>

    <IDSymbol name="ConvertToSubMenuGroup" value="0x1151"/>


    <IDSymbol name="ConvertToSimplePropertyCommand" value="0x701"/>


Posted on Thursday, February 25, 2010 3:28 AM | Back to top

Comments on this post: Creating a SubMenu for a VisualStudio 2008's DSL designer ContextMenu

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © markritchie | Powered by: