This project has moved and is read-only. For the latest updates, please go here.

Image Transparency on a VBE Tool Bar

Dec 10, 2014 at 3:07 PM
Edited Dec 10, 2014 at 3:16 PM
I am adding a custom icon to my tool bar button using button.PasteFace(). However, when the icon appears in the VBE (Excel 2010) it is surrounded by a dark grey box. I am trying to figure out how to apply the icon in such a way that the 'natural' colour of the VBE shows through and the icon blends into the VBE.

So far I have:
  1. Looked at using button.Mask, but cannot see how to use it through NetOffice. My code is run as an add-in, so I'm 'in process' and feel I should be able to use this method.
  2. Using bitmap.MakeTransparent() on the icon before I copy it to the clipboard and paste it to the button using PasteFace(). This seems to have no effect.
Has anyone been able to set transaparent custom icons on the classic UI? Any concrete code examples would be greatly appreciated.
Dec 11, 2014 at 4:04 AM
Same Question as you. maybe the Button.Mask...
Dec 12, 2014 at 12:16 PM
what i use in my addin projects here is stdole.IPictureDisp very similar to this one:

the problem with IPictureDisp is its only available in so called 'in-proc servers' in other words addins.
but it works!