How Delphi dynamically generated button onclick calls pass parameters

ExpandedBlockStart.gif 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 ;  

 

Reproduced in: https: //www.cnblogs.com/rogee/archive/2010/09/20/1832040.html

Guess you like

Origin blog.csdn.net/weixin_33772645/article/details/94681087