線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1384
推到 Plurk!
推到 Facebook!

若要熟悉Notification機制,是否有參考資料或書籍?

尚未結案
g9221712
高階會員


發表:145
回覆:344
積分:162
註冊:2006-07-06

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-01-06 05:43:32 IP:220.134.xxx.xxx 訂閱
版主大人及前輩大大:
想詢問一下Notification機制要參考哪些機制,因為我自訂元件內有自訂DataSource,但是
我發現若是我有將自己寫的元件設定DataSource,我卻無法在表單上移除或移除時會出現警告訊息
,但是我一將這個元件的DataSource清空,卻可以正常移除,不知道我問題發生在哪裡!

procedure YaoFRM.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) then
begin
// if (DataSource <> nil) and (AComponent = DataSource) then
if (AComponent = DataSource) then
DataSource := nil;
end;
end;
------
「人們所以覺得寂寞,是因為他們會築牆,卻不會搭橋。」
程式寫的越久,卻發現自己越來越不會寫程式!
g9221712
高階會員


發表:145
回覆:344
積分:162
註冊:2006-07-06

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-01-06 06:00:08 IP:220.134.xxx.xxx 訂閱
 我找了一下help資料
Notification method (IDesignerNotify) IDesignerNotify
TOperation represents the types of operations whose occurrence is broadcast by the Notification method.
Unit
Classes
Delphi syntax:
type TOperation = (opInsert, opRemove);
Description
The TOperation type is used in the Notification method to indicate whether the notification
indicates the creation or deletion of an object. The following table gives the possible values:
Value Meaning
opInsert The specified object has just been created.
opRemove The specified object has been destroyed, and its memory is about to be freed.
------
「人們所以覺得寂寞,是因為他們會築牆,卻不會搭橋。」
程式寫的越久,卻發現自己越來越不會寫程式!
系統時間:2024-05-13 19:44:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!