Custom component creation - how to add small icon representing component in Tool Palette?

蓝咒 提交于 2021-02-07 13:34:45

问题


Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette.

I've read that I should name my two other BMP files which are contained in DCR file like this:

MyComponentName16 [for 16x16 BMP file]

MyComponentName32 [for 32x32 BMP file]

Unfortunately this does not seem to work, I've tried to restart Delphi few times in hope that it might be the case of not refreshing something, but without any success.

Any ideas?


回答1:


You may try to clear the IDE package cache:

  • uninstall the component's package from your Delphi IDE
  • in registry browse to the following key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Package Cache\
  • find and delete the key corresponding to your package name (like MyPackage.bpl)
  • now browser to the next key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Palette\Cache\
  • find and delete the key corresponding to your package name (like MyPackage.bpl)
  • and finally try to install your package back; now it should appear with proper icons

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

As another workaround you might try to run Delphi IDE with undocumented command line parameter:

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


来源:https://stackoverflow.com/questions/10056653/custom-component-creation-how-to-add-small-icon-representing-component-in-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!