Menus Element

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Menus Element.

Defines all the menus and toolbars that a VSPackage implements.

<Menus>  
  <Menu>... </Menu>  
  <Menu>... </Menu>  
</Menus>  

The following sections describe attributes, child elements, and parent elements.

Attributes

AttributeDescription
ConditionOptional. See Conditional Attributes.

Child Elements

ElementDescription
Menus ElementDefines all the menus and toolbars that a VSPackage implements.
Menu ElementRepresents a single menu or toolbar.

Parent Elements

ElementDescription
Commands ElementRepresents the collection of commands in the VSPackage.
<Commands package="guidMyPackage">  
    <Menus>  
      <Menu Condition="'%(DEBUG)' != 'true'"   
        guid="cmdSetGuidMyProductCommands" id="menuIDMainMenu"   
        priority="0x0000" type="Menu">  
        <Annotation>  
          <Documentation>this is an annotation</Documentation>  
          <AppInfo>  
            <CustomData>  
              <CustomSubElement>Some data</CustomSubElement>  
            </CustomData>  
          </AppInfo>  
        </Annotation>  
        <CommandFlag>AlwaysCreate</CommandFlag>  
        <Strings>  
          <ButtonText>MainMenu</ButtonText>  
        </Strings>  
      </Menu>  
  </Menus>  
<Commands>  

How VSPackages Add User Interface Elements
Commands, Menus, and Toolbars

Show: