请教,这语句if sender=freshname是什么意思?
解决方案 »
- 如何编写提取人对话的程序?
- 枚举类型的数据与字符串数据如何相互转换呢?
- 一个简单的UDPServer组建应用程序
- dephi中如何设置windows的系统时间
- MYSQL网络应用问题?
- delphi中怎么实现access的备份和恢复操作,再线等待!!!!!!
- 我很想找个搞程序的男朋友
- 简单的问题。。。。。。。。。。。。。。。。。。。。。
- delphi 2010 与delphi 7 的char问题,很急手
- TImage简单问题
- 请问这是什么意思? TRxBufEvent = procedure(Sender: TObject; const Buffer;
- 事件中的参数——Sender的问题很简单的——在线等待!
if sender=button1 //判断事件是不是button1的事件
if Longint(sender)=Longint(freshname) then
Using the Sender parameter
n an event handler, the Sender parameter indicates which component received the event and therefore called the handler. Sometimes it is useful to have several components share an event handler that behaves differently depending on which component calls it. You can do this by using the Sender parameter in an if...then...else statement. For example, the following code displays the title of the application in the caption of a dialog box only if the OnClick event was received by Button1.procedure TMainForm.Button1Click(Sender: TObject);
begin
if Sender = Button1 then
AboutBox.Caption := 'About ' + Application.Title
else
AboutBox.Caption := '';
AboutBox.ShowModal;
end;