TVirtualImageList does not adapt to the size of the assigned button

Hello, when I use lists of type TVirtualImageList, how can I make the icons adapt to the size of the automatically assigned button? it always takes the width and height assigned in the TVirtualImageList itself, this is not the desired behavior, it should autoadjust to the size of the button since it is SVG format.
This is necessary since sometimes I use buttons with a size of 20X20 and others with a size of 40X40 with the same list. This did the previous TImageList lists well, why doesn't TVirtualImageList do the same?

There is no relationship between button & TVirtualImageList where a change in button size will trigger a change in TVirtualImageList image size. The TVirtualImageList image size only changes with DPI changes for example.
So, if your button changes size for other reasons, you'll need to programmatically instruct the TVirtualImageList to resize the images.

Hello, sorry for the delay, due to holidays and last minute jobs. I am using a TVirtualImageList of width and height of 32, this list is assigned to all the buttons in my program, but there are some icons that are smaller than others, if you resize the list in code as you mention, it changes the size in all the icons in the program, I only need to adapt it to the icons with smaller sizes, then the solution is to create various TVirtualImageList of different sizes? With normal image lists I remember that these adapt automatically without the need to duplicate lists with different sizes.

TVirtualImageList is a standard VCL component and not a TMS component.
TVirtualImageList assumes all images are the same size. If you need different sizes, you should use different TVirtualImageList instances.

Ok, thanks for the clarification, I will create several lists with different sizes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.