nbsp; Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinForm.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
var
A,B,C:TClassTest;
begin
A.FA :=1;
B.FA :=2;
C:=A+B; //两个结构(或者类)用+操作,在DELHI8以前是不可想象的
system.Windows.Forms.MessageBox.Show(System.Convert.ToString(C.FA) );
end;
{ TClassTest }
//重载“+”操作符的实现
class operator TClassTest.add(A, B: TClassTest): TClassTest;
begin
Result.FA:=A.FA + B.FA;
end;
end.