The following code works for putting an image on a button being added to the toolbar but is there an easier way to get the image?
- Code: Select all
ButtonTool buttonTool = new ButtonTool("ID_Export");
buttonTool.SharedProps.Caption = "Export";
buttonTool.Key = "ID_Export";
buttonTool.InstanceProps.MinimumSizeOnRibbon = Infragistics.Win.UltraWinToolbars.RibbonToolSize.Normal;
buttonTool.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText;
JiwaFinancials.Jiwa.JiwaApplication.Image.ImageCollection imgcol = new JiwaFinancials.Jiwa.JiwaApplication.Image.ImageCollection();
imgcol.Manager = Manager;
imgcol.Read();
JiwaFinancials.Jiwa.JiwaApplication.Image.Image img = imgcol.GetItem("Name", "Creditors.32x32");
System.IO.MemoryStream imstream = new System.IO.MemoryStream(img.ImageBinary);
Image bmpImage = new Bitmap(imstream,false);
buttonTool.SharedProps.AppearancesSmall.Appearance.Image = bmpImage;
this.UltraToolbarsManager1.Tools.Add(buttonTool);
Infragistics.Win.UltraWinToolbars.RibbonGroup rbgroup = this.UltraToolbarsManager1.Ribbon.Tabs["Main"].Groups["Actions"];
rbgroup.Tools.AddTool("ID_Export");
buttonTool.ToolClick += Export_ToolClick;