Solved

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

Posted on 2001-07-03
5
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error E2158 compiling with Delphi XE10 Seattle 2 142
SUM 2 INTEGER ARRAYS INTO 1 10 118
How to convert memory stream to PDF file 6 230
Firemonkey Tcameracomponent resultion 1 48
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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