Code
//
custom event process, process name can be taken
Procedure TForm1.OnClick (Sender: TObject);
the begin IF Sender IS the TButton the then the begin IF the TButton (Sender) .Name = ' Button1 ' the then ... The else IF the TButton (Sender) .name = ' Button2 ' the then ... End ; End ; // Create the TButton var BTN: the TButton; the begin BTN: = TButton.Create (the Application); btn.Name: = ''
; // own definition, be careful not to duplicate
btn.Caption: = '' ; // own definition btn.OnClick: = the OnClick; End ;
Procedure TForm1.OnClick (Sender: TObject);
the begin IF Sender IS the TButton the then the begin IF the TButton (Sender) .Name = ' Button1 ' the then ... The else IF the TButton (Sender) .name = ' Button2 ' the then ... End ; End ; // Create the TButton var BTN: the TButton; the begin BTN: = TButton.Create (the Application); btn.Name: = ''
; // own definition, be careful not to duplicate
btn.Caption: = '' ; // own definition btn.OnClick: = the OnClick; End ;
Reproduced in: https: //www.cnblogs.com/rogee/archive/2010/09/20/1832040.html