0

What is the code to use in config.esriaddinx in order to make a Button-Menu (like that illustrated below) when using ArcObjects?

enter image description here

2

What you are identifying in your image is a ToolPalette not a Button or Menu. So use the AddIn Wizard to create your Buttons that you want to see in the ToolPalette then create the ToolPalette and add the buttons by their ID. Below is some demonstration code to get you going.

<ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Name>ArcMapAddinDummy</Name>
  <AddInID>{0b218af0-012d-4efc-899e-519305155118}</AddInID>
  <Description>Type in a description for this Add-in.</Description>
  <Version>1.0</Version>
  <Image>Images\ArcMapAddinDummy.png</Image>
  <Author>hornbydd</Author>
  <Company>University of Southampton</Company>
  <Date>30/06/2015</Date>
  <Targets>
    <Target name="Desktop" version="10.3" />
  </Targets>
  <AddIn language="CLR" library="ArcMapAddinDummy.dll" namespace="ArcMapAddinDummy">
    <ArcMap>
      <Commands>
        <Button id="University_of_Southampton_ArcMapAddinDummy_Button1" class="Button1" message="Add-in command generated by Visual Studio project wizard." caption="My Button" tip="Add-in command tooltip." category="Add-In Controls" image="Images\Button1.png" />
        <Button id="University_of_Southampton_ArcMapAddinDummy_ArcGISAddin2" class="ArcGISAddin2" message="Add-in command generated by Visual Studio project wizard." caption="My Button2" tip="Add-in command tooltip." category="Add-In Controls" image="Images\ArcGISAddin2.png" />
        <ToolPalette id="University_of_Southampton_ArcMapAddinDummy_My_Tool_Palette" caption="My Tool Palette" category="Add-In Controls" isMenuStyle="true" columns="1">
          <Items>
            <Item refID="University_of_Southampton_ArcMapAddinDummy_Button1" />
            <Item refID="University_of_Southampton_ArcMapAddinDummy_ArcGISAddin2" />
          </Items>
        </ToolPalette>
      </Commands>
      <Toolbars>
        <Toolbar id="University_of_Southampton_ArcMapAddinDummy_My_Toolbar" caption="My Toolbar" showInitially="true">
          <Items>
            <ToolPalette refID="University_of_Southampton_ArcMapAddinDummy_My_Tool_Palette" />
          </Items>
        </Toolbar>
      </Toolbars>
    </ArcMap>
  </AddIn>
</ESRI.Configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.