创建自定义组件-如何在“工具选项板"中添加代表组件的小图标? [英] Custom component creation - how to add small icon representing component in Tool Palette?

查看:78
本文介绍了创建自定义组件-如何在“工具选项板"中添加代表组件的小图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请记住,我已经阅读了所有有关在自定义组件中添加组件图标的说明.当我们谈论图标尺寸为24x24像素时,我能够做到这一点.将组件放置在表单上时,我会看到该图标.但是,我在浏览工具面板"时看不到应该显示的16x16小图标.

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.

我已经阅读,我应该将另外两个BMP文件命名为包含在DCR文件中,如下所示:

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

MyComponentName16 [用于16x16 BMP文件]

MyComponentName16 [for 16x16 BMP file]

MyComponentName32 [用于32x32 BMP文件]

MyComponentName32 [for 32x32 BMP file]

不幸的是,这似乎不起作用,我尝试过几次重启Delphi,以希望不刷新某些内容但没有成功.

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.

有什么想法吗?

推荐答案

您可以尝试清除IDE软件包缓存:

You may try to clear the IDE package cache:

  • 从Delphi IDE卸载组件的程序包
  • 在注册表中浏览到以下项
    HKEY_CURRENT_USER \ Software \ CodeGear \ BDS \ 6.0 \ Package Cache \
  • 找到并删除与您的软件包名称相对应的密钥(例如 MyPackage.bpl )
  • 现在浏览器到下一个键
    HKEY_CURRENT_USER \ Software \ CodeGear \ BDS \ 6.0 \ Palette \ Cache \
  • 找到并删除与您的软件包名称相对应的密钥(例如 MyPackage.bpl )
  • 最后尝试重新安装您的软件包;现在它应该显示适当的图标

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

作为另一种解决方法,您可以尝试使用未记录的命令行参数运行Delphi IDE:

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

这篇关于创建自定义组件-如何在“工具选项板"中添加代表组件的小图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆