这样行吗?
if (Sender as TButton).Caption='预览报表' then
showmessage('预览') else showmessage('打印');
还是有更简单的方法呢。

解决方案 »

  1.   

    还可以这样做:1。设置按钮的Tag属性:“预览报表”为0;“打印报表”为1;
    2。case (Sender as TButton).tag of
       begin
         0:...
         1:...
       end;
    这也是比较典型的方法。
      

  2.   

    用Capion 来判断是最愚蠢的办法(用到多语言你用知道了)
     用wwwxing(孤独的海洋,蓝色的月光) 的吧
      

  3.   

    case (Sender as TButton).tag
      

  4.   

    又学了一招,TAG(未定义的属性)。
      

  5.   

    if Sender=Button_Prev then
    showmessage('预览') else showmessage('打印');