How to add image to CommandBarButton?



I have made a small addin with commandBar and buttons on it. How i can set icon for buttons?

Now i have only button name "test button" in bar and i want to see something like this "Smiley Happytest button".


Thank you for any information.


Posted by: Walker
Post date: 6/13/2012 8:28:07 AM


Re: How to add image to CommandBarButton?

When you call SetAddinInfoEx you will pass in the filename (full path) to your resource DLL and the call has resource IDs for large and small buttons (we ignore the monochrome args now). You should be able to create glyphs and put you images into the glyphs and then pass the IDs in the call. Edge should automatically create your icons.


You can also call LoadFace API on the returned button but that's the hard way. The sdk\samples\addins\vc add-in sample shows you how to do the glyphs.


Posted by: R.D. Holland
Post date: 6/26/2012 3:32:59 PM