Solved

Form Icons

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Activex loadlibrary and show parented form issue 6 286
problem when i try to pack my dll file with upx 9 72
Working with hours 3 46
Convert a string into a TDateTime 5 52
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 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