Solved

How do I add an icon to an ActiveX control in Delphi?

Posted on 2001-07-03
5
259 Views
Last Modified: 2010-04-06

Should be easy for someone who knows:

How do I change the icon image for an ActiveX control that I am trying to build in Delphi 5?

By default it comes up as those funny 3d shapes.

I know how to do it when creating custom VCL components (ie you create the .dcr file using image editor), but it doesn't seem to work on ActiveX components.

0
Comment
Question by:JLANE
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6249394
- Start Delphi's image editor.
- Create a new dcr-file.
- Add a new 24x24 Bitmap to the content.
- The name should be like TMyActiveX
- Edit the image
- Save it with the same name as the .pas file except that it must be .dcr now.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6249415
Forget the above. When you import the ActiveX Control into delphi, the .dcr file is created automatically in the imports directory. Just edit that one.

(Delphi 5)
0
 

Author Comment

by:JLANE
ID: 6249481
Epsylon:
I don't really want to ask all of my customers to edit the icon every time they import my activex control! Anyway, this doesn't work for VB users etc.

There must be a simple way to change the icon that is compiled into the .ocx file.
0
 
LVL 17

Accepted Solution

by:
inthe earned 300 total points
ID: 6249965
edit the bitmap from the .res file and rebuild the project to get the new icon in your activex ready for deployment.

1. Open you ActiveX projects .res file ( Your projectname.res in the same
dir as  your project ) in the image editor.
2. Edit the Bitmap 1 to your image.
3. Close the Bitmap editor.
4. Save  the Res File and exit.
5. Open your ActiveX project and then do a Build All.
6. Remove the ActiveX control from the associated package file and compile
the package file. You should then get a message saying "This control is no
longer registered.. ".
7. Import the ActiveX Control back into the package and recompile the
package. You should then get a message indicating a new control has been
registerd.
0
 

Author Comment

by:JLANE
ID: 6251715
Don't know why it didn't work the first 10 times I tried.

Maybe the Build All...

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now