全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:701
推到 Plurk!
推到 Facebook!

sender:tobject一問

尚未結案
sundy6719
初階會員


發表:136
回覆:78
積分:42
註冊:2002-07-10

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-06-26 17:57:33 IP:203.70.xxx.xxx 未訂閱
請問一下加入sender:tobject和不加入有什麼差別 procedure aaa(sender:tobject); begin end; 和 procedure aaa; begin end;
qoo1234
版主


發表:256
回覆:1167
積分:659
註冊:2003-02-24

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-06-26 19:47:42 IP:61.219.xxx.xxx 未訂閱
In 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;
系統時間:2024-06-24 21:18:41
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!