Articles   Members Online: 3
-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 determine if an object has an event assigned to it 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
Determine if an object has an event assigned to it 04-Jul-05
Category
VCL-General
Language
Delphi All Versions
Views
159
User Rating
3
# Votes
1
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   //this sample show how to deturmin if a object has an event assigned to it.
3   unit Unit1;
4   
5   interface
6   
7   uses
8     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
9     Dialogs, StdCtrls;
10  
11  type
12    TForm1 = class(TForm)
13      Button1: TButton;
14      procedure Button1Click(Sender: TObject);
15    private
16      { Private declarations }
17    public
18      { Public declarations }
19    end;
20  
21  var
22    Form1: TForm1;
23  
24  implementation
25  
26  {$R *.dfm}
27  
28  procedure TForm1.Button1Click(Sender: TObject);
29  begin
30  
31    if addr(Button1.onclick)<>nil then//use addr to find addresss of onClick event
32     showmessage('This Button has a OnClick an event assigned to it')
33     else
34     showmessage('This Button do not have a OnClick an event assigned to it');
35  
36    if addr(Button1.onExit)<>nil then//use addr to find addresss of onExit event
37     showmessage('This Button has a OnExit an event assigned to it')
38     else
39     showmessage('This Button do not have a OnExit an event assigned to it')
40  
41  end;
42  
43  end.


			
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