Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DelphiʰÒÅ£¨8£© Ààʼþ

ÀàµÄʼþ
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TMyEvent = procedure of object; //²»´ø²ÎÊýµÄ¹ý³Ì
TMyEventExt = procedure(AName: string) of object; //´ø²ÎÊýµÄ¹ý³Ì

TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TMyBase = class
private
FName : string;
FAge : Integer;
FOnEvent: TMyEvent; //¶¨Òå TMyEvent ÀàÐÍʼþ
FOnEventExt: TMyEventExt;
procedure SetAge(const AValue: Integer);
public
//´´½¨Ààʱ½øÐÐÏàÓ¦µÄһЩ³õʼ»¯¹¤×÷
constructor Create;
procedure SetEvent1;
procedure SetEvent2;
procedure SetEventExt1(ATmp: string);
//NameÊôÐÔ ²»¿É¸ü¸Ä
property Name: string read FName write FName;
//AgeÊôÐÔ ¿ÉÒÔ¸ü¸Ä
property Age: Integer read FAge write SetAge;
//¹ØÁªÊ¼þ ·¢²¼ TMyEvent ÀàÐÍʼþ
property OnEvent: TMyEvent read FOnEvent write FOnEvent;
property OnEventExt: TMyEventExt read FOnEventExt write FOnEventExt;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMyBase }
constructor TMyBase.Create;
begin
FName := 'hehf';
FAge := 99; //²»¸³ÖµÊ±Ä¬ÈÏΪ0
FOnEvent := SetEvent1;
FOnEventExt := SetEventExt1; //Õâʱ²»ÄÜ´ø²ÎÊý
end;
procedure TMyBase.SetAge(const AValue: Integer);
begin
if (AValue > 0) and (AValue < 130) then
FAge := AValue
else
FAge := -1;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
TmpMy: TMyBase;
begin
TmpMy := TMyBase.Create;
ShowMessage(IntToStr(TmpMy.Age)); // 99
TmpMy.Age := 100;
ShowMessage(IntToStr(TmpMy.Age)); // 100
TmpMy.OnEvent; //´¥·¢¹ØÁªÊ¼þ
TmpMy.Free;
end;
procedure TMyBase.SetEvent1;
begin
ShowMessage('Event 1'


Ïà¹ØÎĵµ£º

Delphi¶à²ã¿ª·¢·½°¸±È½Ï


±êÌâ
  Delphi¶à²ã¿ª·¢·½°¸±È½Ï    £¨×ªÔØ£©
¹Ø¼ü×Ö
  Delphi¶à²ã¿ª·¢·½°¸±È½Ï
³ö´¦
 
·½°¸->
Midas
DCOM
COM+
ASTA
RemoteObject
.NET
ÌṩÕß
Borland
΢Èí
΢Èí
http://www.astatech.com
http://www.remobjects.com
΢Èí
ºËÐļ¼Êõ
COM
COM
COM
ASTA×Ô¼ ......

ÔõÑùÓÃDELPHI½ÓÊÕÉãÏñÍ·µÄͼÏó

community.csdn.net/Expert/topic/3423/3423580.xml?temp=.7675897
Ö÷¡¡¡¡Ì⣺  ÔõÑùÓÃDELPHI½ÓÊÕÉãÏñÍ·µÄͼÏó 
×÷¡¡¡¡Õߣº  benbenpear (±¿±¿) 
µÈ¡¡¡¡¼¶£º   
ÐÅ Óþ Öµ£º  100 
ËùÊôÉçÇø£º  Delphi GAME£¬Í¼Ðδ¦Àí/¶àýÌå 
ÎÊÌâµãÊý£º  0  ......

Delphi ÈÕÆÚº¯Êý

Day ¿ªÍ·µÄº¯Êý
¡ñ
Unit
DateUtils
function DateOf(const Avalue: TDateTime): TDateTime;
ÃèÊö
ʹÓà DateOf º¯ÊýÓÃÀ´°ÑÒ»¸ö TDateTime ÀàÐ͵ıäÁ¿×ª±ä³ÉÒ»¸ö
Ö»´øÓÐÈÕÆÚµÄ TDateTime ÀàÐͱäÁ¿¡£
ÀýÈ磺
showmessage(DateTimetostr(dateof(now())));
ÄãµÃµ½µÄÊÇ 2003/03/19
¶ø showmessage(DateTime ......

DelphiʰÒÅ£¨7£© ²ÎÊýÓë·µ»ØÖµ

unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ