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

Adding published properties to forms and datamodul

 
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-02-11 14:22:32 IP:61.218.xxx.xxx 未訂閱
Adding published properties to forms and datamodules    資料來源: www.delphi3000.com    when I add published properties to a form / datamodule decendent, what don't I see them is the object inspector?    In order to see properties of decendent forms / datamodules in the object inspector, we need three actions:     1. Define the property as published, with a type the object inspector can handle.  note that the object inspector does not handle interface types (in delphi 5). 
TMyForm = class(TForm) 
Published 
  Property MyProp: Integer; 
End;     
2. Add a register procedure to some unit ( I recomend another unit, that will be included only in design-time package ).
// for TForm decendents: 
Procedure Register; 
Begin 
  RegisterNoIcon([TMyForm]); 
  RegisterCustomModule(TMyForm , 
    TCustomModule); 
End;     // for TDataModule decendents: 
Procedure Register; 
Begin 
  RegisterNoIcon([TMyForm]); 
  RegisterCustomModule(TMyForm , 
    TDataModuleDesignerCustomModule); 
End; 
the class TDataModuleDesignerCustomModule is in the DMDesigner unit, for which we have no source. The unit is in the dsnide50.bpl. In order to use this unit we have to include the dsnide50.bpl package in our's package 'Requires'. As this package is used only by the delphi IDE, I recommend to add it only to a design-time packages. 3. Compile and install the new package. Now we will see the new property in the object inspector. 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
系統時間:2024-04-20 15:57:45
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!