Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

18 Experts available now in Live!

Get 1:1 Help Now