Solved

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

Posted on 2001-07-03
5
265 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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