Solved

Form Icons

Posted on 2004-03-25
5
226 Views
Last Modified: 2010-04-05
How do you use an image from and ImageList as a forms icon ?
0
Comment
Question by:blue220
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
shaneholmes earned 50 total points
ID: 10679982
var
 Icon: TIcon;

  Icon := TIcon.Create;
  ImgList.GetIcon(0, Icon);
  Application.Icon.Assign(Icon);
  Icon.Free;


Shane
0
 

Author Comment

by:blue220
ID: 10680293
Thx for the reply and in most cases that would do the trick but in this case it wont and here is why.

I have 2 forms in my program (Main & Sub) and on the Main form I have an ImageList and 2 buttons and what I need to do is when I click on one of the buttons an icon from the ImageList is assigened to the Icon of the Sub form.

Example (pseudo code)

Main Form
------------------
ImageList (with image of happy face and sad face)
2 Buttons

Button1.Click (assign happy face Icon to Sub Form)
SubForm.ShowModal;

Button2.Click (assign sad face Icon to Sub Form)
SubForm.ShowModal

Hope that helps explain things better and thx again for any and all replies.
0
 

Author Comment

by:blue220
ID: 10680376
Nvm I modified your code abit and it's working thx
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10680425
Well, you never said anything about a second form in your question,

please be specific on exactly what you want when asking questions, so experts do not have to recode.....

Sahne
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10680435
OK, i was doing a solution up to modify the icon of the second form

Anyway, thanks and good luck!

Shane
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

20 Experts available now in Live!

Get 1:1 Help Now