?
Solved

Form Icons

Posted on 2004-03-25
5
Medium Priority
?
243 Views
Last Modified: 2010-04-05
How do you use an image from and ImageList as a forms icon ?
0
Comment
Question by:blue220
[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
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
shaneholmes earned 200 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

Industry Leaders: 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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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