?
Solved

Assigning Component Icons

Posted on 1999-06-24
2
Medium Priority
?
214 Views
Last Modified: 2010-04-06
How do you put an icon into a component(that i've made) so that when you install it, it comes up on the component pallete with my own icon?

Thanks
0
Comment
Question by:captainklink
2 Comments
 
LVL 15

Accepted Solution

by:
simonet earned 200 total points
ID: 1384398
A component image (because it's a bitmap, and not an icon) is bitmap resource with a special name contained in a resource file with extension .DCR.

In order to create this resource file, you can use Image Editor (that comes with Delphi).

Here are the steps to follow:
1) Open Image Editor
2) Select File| New | Component Resource File (.dcr). A new resource file with extension .dcr will be created
3) Now select Resource | New | Bitmap. When Image Editor asks for the image size, select 24x24
4) Now just create the bitmap for your component using the tools provided by Image Map.
5) Now close the bitmap. On the untitled.dcr window (the "resource's project"), click once on the Bitmap1 caption and change its name to the name of your component, use all uppercase letters (example: TDBMYEDIT)
6) Save the DCR file using the same name of the PAS file where your component is. If the PAS file is myedit.pas, then save the DCR file as myedit.dcr
7) in the .PAS file for your component, add a line like:
{$R myedit.dcr}
8) Rebuild the package where the component is.
9) That's it.

Yours,

Alex
Athena's Place: http://www.bhnet.com.br/~simonet


0
 

Author Comment

by:captainklink
ID: 1384399
Thanks, very helpfull!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question