Adding an image to add-in multi-item.item

240
1
08-26-2010 11:20 AM
LesleyBross
New Contributor II
I need to add an image to some items in my multi-item collection to be displayed in a dropdown menu. First question is how to add images to an add-in project. I know that they have to be added so that they can be included in the packaged add-in file. Just copying them into the /images directory in the add-in project folder doesn't seem to work.

Second question is how to access them in the customized multi-item class. MultiItem.Item.Image property requires a System.Drawing.Image object. I've tried to create this with Image.FromFile method which requires a system path. The only thing that works is the complete path to the image on my machine which isn't pointed at the add-in and obviously wouldn't work anywhere else.

Thoughts?
0 Kudos
1 Reply
LesleyBross
New Contributor II
So, as usual, I was way overthinking this. A better way to accomplish my goal is to create a button control for each item on my menu. Button controls have images associated with them. Configure buttons under the Items property of Menu. And voila!

BTW, if you want to disable a button at startup, you need to set the onDemand property to false in the XML. This is in the doc but I didn't see it right away.
0 Kudos