Solved

How do I show Application.Icon on a form?

Posted on 2001-07-15
6
154 Views
Last Modified: 2010-04-06
I want to make a generic About box that pulls all the info from the Version resource information in the .EXE.  I have written 98% of it, but now I'm stuck.  I want to display the program icon on the About box, but I don't want to have to read it from a file, I want to use the image in Application.Icon.

However, one cannot put a TIcon object on a form, and cannot assign a TIcon iamge to a TImage image, so how can I achieve this?

If I cannot take it directly from the Application object, how would I read is from the resource info in the .EXE?
0
Comment
Question by:DrBeaker
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6284060
Try this


Image1.Picture.Icon := Application.Icon;


The Crazy One
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 100 total points
ID: 6284068
Hello

  if you want the read the application icon and put it in the image components, that's easy

  Image1.Picture.Assign(application.icon);

Best regards
Mohammed Nasman
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6284070
damn slow :(
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Author Comment

by:DrBeaker
ID: 6284320
I actually did it by

DrawIcom(Image1.Canvass.Handle, 0, 0, Application.Icon,Handle);

which has got to be the fastest way ... unless anyone can see a problem here?
0
 
LVL 2

Author Comment

by:DrBeaker
ID: 6284326
Image1.Picture.Icon.Assign(application.icon);

Also seems to work.
0
 
LVL 2

Author Comment

by:DrBeaker
ID: 6284353
CrazyOne, I strongly suspect that, in some circumstances (specifically repalcing an icon), your solution could cause a memory leak.  If you use it yourself, consider replacing it with Assign calls.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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