1

I want to set image on menu in ArcMap addin toolbar. is there any way to set image ? I have tried but this is not working.. My code is here in config.esriaddinx:

--Menus> Menu id="GridViewMenu" caption="Element View" image="Images\gridview" isRootMenu="false"> Items> Button refID="Button1" /> /Items> /Menu> /Menus>

  • 1
    Is that really code from your config file? I'm no expert in XML but it looks like you do not have the appropriate syntax, opening and closing tags. – Hornbydd Jun 24 '15 at 11:53
  • I'm not sure about the menu bit but shouldn't image="images\gridview" have an extension? Only certain image types are allowed (Microsoft types, not Esri types) so an Esri GRID is not the right type. I do think there's something funny with your XML but that's probably this web page doing funny things, try formatting your code as code. Save your images\gridview as .png and change to image="Images\gridview.png" and it should work. – Michael Stimson Jun 24 '15 at 22:05
  • <Menu id="GridViewMenu" caption="Grid View" image = "Images\GridView.png"> <Items> <Button refID="GridItemOneButton" /> </Items> </Menu> – Monir Jun 28 '15 at 6:15
  • Here is my code , but still I cann't show image on menu – Monir Jun 28 '15 at 6:27
1

From one of my tools:

<Button id="ButtonName" 
                class="Button1" 
                message="Does some stuff." 
                caption="My Button" 
                tip="Does some stuff" 
                category="MyAddin" 
                image="Images\Button1.png" />

As you can see the image has an extension and the XML is properly closed.. your XML should read like:

  <Commands>
    <Button id="GridViewMenu" caption="Element View" image="Images\gridview.png" isRootMenu="false"/>
  </Commands>
  <Menus>
    <Menu>
      <Items>
        <Button refID="your_namespace_GridViewMenu" />
      </Items>
    </Menu>
  </Menus>

Where the properties of the tool are declared in the <Commands> enclosure an then the tool is added to the menu later on by using its fully qualified name.

I am assuming that a menu follows the same layout as a toolbar. All my existing menus are 'old style' like this and not generated via XML.

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.