Creating custom components - how to add a small icon representing a component in the tool palette?

Please keep in mind that I read all the instructions that I could find about adding a component icon to my custom component. And I can do this when we talk about the size of the icon, which is 24x24 pixels. I see an icon when a component is dropped on a form. However, I do not see a small 16x16 icon that should be displayed when viewing the tool palette.

I read that I should name two other BMP files that are contained in the DCR file, for example:

MyComponentName16 [for BMP 16x16 file]

MyComponentName32 [for BMP 32x32 file]

Unfortunately, this does not seem to work, I tried to restart Delphi several times in the hope that this might be the case when you are not updating anything, but without any success.

Any ideas?

+6
source share
1 answer

You can try to clear the cache of the IDE package:

  • remove the component package from your Delphi development environment
  • in the registry, go to the next key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Package Cache\
  • find and delete the key corresponding to the name of your package (for example, MyPackage.bpl )
  • now the browser for the next key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Palette\Cache\
  • find and delete the key corresponding to the name of your package (for example, MyPackage.bpl )
  • Finally, try installing the package back; it should now appear with the corresponding icons

Source: http://www.lnssoftware.ca/blog/?p=140

As another workaround, you can try running the Delphi IDE with an undocumented command line parameter:

 c:\Program Files (x86)\CodeGear\RAD Studio\6.0\bin\bds.exe -nocache 
+6
source

Source: https://habr.com/ru/post/912662/


All Articles