label点击事件中,如何取得这个label的caption值(100)

  • 主题发起人 再苦也不说累
  • 开始时间

再苦也不说累

Unregistered / Unconfirmed
GUEST, unregistred user!
如题,因为有很多个label要用到这个事件
 
tlabel(sender).caption
 
楼上的正解,可以在此之前添加判断,如有不同控件类使用了该事件的话:if TComponent(sender).ClassName='TLabel' thenbegin if Tlabel(sender).caption='label1' then ; else if Tlabel(sender).caption='label2' then ;end;
 
Tlabel(FindComponent( label+inttostr(i))).caption;
 
二楼正解:Str:=TLabel(Sender).Caption;
 
多人接受答案了
 
顶部