Delph components How to use your own icon

xiaoxiao2021-03-06  107

How to use the components developed by Delphi? What is the mystery?. Component uses your own icon to do the following steps: (1) Write information about components: I want to register with the component named TNWTreport In the NWTREPORT.PAS unit. (2) Make a DCR file with the unit file of the unit file where your component is located, which is nwtreport.dcr, add a 24 * 24 Bitmap file to the file, name must be Your component name is consistent, and all uppercase, this is TNWTreport. (3) Put the nwtreport.dcr in the same directory of component unit NWTREPORT.PAS (4) Renew in your component package NWTREPORT7.DPK, add components Unit NWTREPORT.PAS, at this time, a DCR file NWTREPORT.DCR is automatically added in the component package NWTREPORT 7.DPK. (5) recompile, install, and you can.

Note: The above work can be done with the Image Editor software comes with Delphi. DCR is actually a resource file, which can contain a number of 24x24 size 16-color Bitmap, which is used when designing, is displayed in the Component Platte. Control icon. When the IDE loads a component package xxx.bpl,

It will find a file named xxx.dcr in the directory where the package is located. If you find it, load this file. For Component named YYY in the package, you will find the resource item named YYY in this resource (Bitmap ), Call this capital

The source item draws represents YYY components in the Component Platte. If you can't find the default Bitmap to draw the components in the package. These Bitmap will not be used at runtime, so this file will not be compiled into the DCU or EXE (BPL). any

The tool that can open the RES file should open the DCR piece. After each item can be saved as a BMP file, you can use it.

转载请注明原文地址:https://www.9cbs.com/read-98779.html

New Post(0)