if Sender = Button1 then 
    do ;
 if Sender = Button2 then
    do ;  

解决方案 »

  1.   

      if (Sender as TButton).Caption = 'Button1' then
        ShowMessage('button1')
      else if (Sender as TButton).Caption = 'Button2' then
        ShowMessage('button2')
      else if (Sender as TButton).Caption = 'Button3' then
        ShowMessage('button3')
      

  2.   

    Liusp(夜深千帐灯) 的方法好像不行哦!
      

  3.   

    liusp 的说法是正确的。very good
      

  4.   

    if( sender is Tbutton) then 
      tbutton(sender).caption=...