Icons

The majority of the controls can have an image associated with them.
The choice of image and display style is controlled by the following attributes:


Control Images

The majority of the controls can have an image associated with them
The choice of image and display style is controlled by the following attributes
Images that are full-color (24 bit) that also have an alpha channel to control the transparency that are saved in .png format (Portable Network Graphic) work best.
'https://bert-toolkit.com/imagemso-list.html


In VBA

imgImageControl.Picture = Application.Commandbars.GetImageMso("sid, 16, 16) 

imageUsed when you want to provide a custom image
imageMsoUsed when you want to use one of the built-in icons
getImageUsed when you want to change a custom controls image while you application is running.
showImageControls whether an image is displayed or not
getShowImage 
showItemImageControls whether an image is displayed for a dropDown, comboBox or gallery item.
getShowItemImage 
sizenormal takes up 1 row
large takes up 3 rows.
getSize 


Loading Images Dynamically

There are two ways to load images dynamically:

  • loadImage callback

  • getImage callback


loadImage Callback

In the root node of your customisation there is a callback attribute called loadImage
This is used in conjunction with the 'image' attribute on individual controls.
The callback attribute 'loadImage' is called everytime the Ribbon asks for an image.
This allows you to define one image handler for the entire application.


<customUI xmlns="??" 
 loadImage="OnLoadImage">

<gallery id="??">
<item id="??" image="MyImage.jpg"/>

Public Sub OnLoadImage(ByVal sImageName As String, _ 
                      ByRef Image As Variant)
   SetImage = LoadPicture("C:\Temp\" & sImageName)
End Sub


getImage Callback

A number of controls provide a getImage callback




getItemImage Callback

We need to create a database table of information related to the images ?




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