Solved

Form Icons

Posted on 2004-03-25
5
230 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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