Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to change your application's icon at runtime. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
changing your application's icon at runtime 08-Jul-04
Category
Graphic
Language
Delphi All Versions
Views
340
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8     Dialogs, StdCtrls;
9   
10  type
11    TForm1 = class(TForm)
12      Button1: TButton;
13      Button2: TButton;
14      procedure Button1Click(Sender: TObject);
15      procedure Button2Click(Sender: TObject);
16    private
17      { Private declarations }
18    public
19      { Public declarations }
20    end;
21  
22  var
23    Form1: TForm1;
24  
25  implementation
26  
27  {$R *.dfm}
28  procedure ChangeIcon(bChange:boolean);
29  var
30  sDir:string;
31  begin
32  sDir:='c:\winnt\';
33  if (bChange) then
34    Application.Icon.LoadfromFile(sDir + 'Test1.ico')
35  else
36    Application.Icon.LoadfromFile(sDir + 'Test2.ico');
37  
38  end;
39  
40  procedure TForm1.Button1Click(Sender: TObject);
41  begin
42   ChangeIcon(true);
43  end;
44  
45  procedure TForm1.Button2Click(Sender: TObject);
46  begin
47     ChangeIcon(false);
48  end;
49  
50  end.
51  


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC