开发者

How to add my icon to component in the component palette page? [duplicate]

This question already has answers here: 开发者_如何学Go Closed 11 years ago.

Possible Duplicate:

delphi non visual component image

How to add my icon to my created component in the component palette page?


To add icon to component you need to create dcr file using Delphi image editor.
In image editor create bitmap 24x24 16 bit. Rename bitmap to your control name.
Example: TMyCustomControl - TMyCustomControl (same name)

How to add my icon to component in the component palette page? [duplicate]

Save dcr file in the folder where the package is with any name (example: Icon.dcr).
Then open your package and right click -> View source.
Add line :
{$R 'The dcr filename'}
In this case:
{$R 'Icon.dcr'}
Click Compile and Install.
There you go. You have created your own component with icon. :)

How to add my icon to component in the component palette page? [duplicate]


  • Create a .dcr file in the Delphi Image Editor.
  • Add a bitmap to this with the same name as your control. It needs to be 24 pixels square, and use 16 colours.
  • Link this .dcr, which is really just a resource file, to your package with a $R in your .dpk for example.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜