Icons


Built-in Icons

If you are using the Ribbon Designer you need to change the OfficeImageId property


Creating Custom Icons

Adding your own custom icons to your solution, and referencing them on the controls using the Image property.


Create the png files
Add them to the project resources
Add the following code to the Ribbon.cs file
SS
Check that you have loadImage="LoadImageCallback" at the top of your XML
SS


#region Ribbon Images Helper 
        private class PictureConverter : System.Windows.Forms.AxHost
        {
            private PictureConverter(string Message)
                : base(Message)
            {
            }

            public static object ImageToPictureDisp(System.Drawing.Image image)
            {
                return System.Windows.Forms.AxHost.GetIPictureDispFromPicture(image);
            }
        }

        public object LoadImageCallback(string ResourceName)
        {
            System.Drawing.Bitmap bitmap = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject(ResourceName);
            return PictureConverter.ImageToPictureDisp(bitmap);
        }
        #endregion ()




© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext