views:

475

answers:

1

I use following class to generate icon for custom toolbar in Excel 2003 from my C# code:

public class ImageConverter : System.Windows.Forms.AxHost
{
    public ImageConverter() : base("59EE46BA-677D-4d20-BF10-8D8067CB8B33")
    {
    }

    public static stdole.IPictureDisp ImageToIpicture(System.Drawing.Image image)
    {            
        return (stdole.IPictureDisp)ImageConverter.GetIPictureDispFromPicture(image);
    }
}

My question is how to make transparent icon? All my icons are transparent gifs, but in Excel 2003 they have solid blue background.

+1  A: 

You need to create an mask image and assign it to commandbarbutton.mask. Refer http://support.microsoft.com/kb/286460/ for more details

gk