Вот такую ссылку нашел:
http://support.microsoft.com/default.aspx?scid=kb;en-us;824017Вот что сделал:
CommandBarButton menubtnConfig;
menubtnConfig.Picture = IconConverter.GetIconByName("icn_Config.ico", this.GetType().Assembly);
menubtnConfig.Mask = IconConverter.GetBmpByName("icn_Config.bmp", this.GetType().Assembly);
и
private class IconConverter : System.Windows.Forms.AxHost
{
private IconConverter() : base(null)
{
}
public static stdole.IPictureDisp Convert(System.Drawing.Image image)
{
return (stdole.IPictureDisp)
System.Windows.Forms.AxHost.GetIPictureDispFromPicture(image);
}
public static stdole.IPictureDisp GetIconByName(string name, Assembly curAsm)
{
System.Drawing.Icon icon = new System.Drawing.Icon(curAsm.GetManifestResourceStream(name));
System.Windows.Forms.ImageList iList = new System.Windows.Forms.ImageList();
iList.Images.Add(icon);
return Convert(iList.Images[0]);
}
public static stdole.IPictureDisp GetBmpByName(string name, Assembly curAsm)
{
return Convert(new System.Drawing.Bitmap(curAsm.GetManifestResourceStream(name)));
}
}