unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TTest = class
StringData: string;
protected
FOnChange: TNotifyEvent;
public
constructor Create;
published
property onChange: TNotifyEvent read FOnChange write FOnChange;
end;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure onChange(Sender: TObject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
oTest: TTest;
begin
oTest := TTest.Create;
oTest.OnChange := onChange;
oTest.OnChange(self);
oTest.Free;
end;
{ TTest }
constructor TTest.Create;
begin
end;
procedure TForm1.OnChange(Sender: TObject);
begin
showmessage('abc');
end;
end.
'델파이 > 델파이관련' 카테고리의 다른 글
reference to procedure, reintroduce (0) | 2017.08.30 |
---|---|
델파이 함수 정리 중 (0) | 2017.04.13 |
델파이 모바일교육 - 고급 (0) | 2015.07.22 |
모바일 기본교육 (0) | 2015.07.21 |
MS-Access *.accdb 연결 Connect String (0) | 2015.04.23 |