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

用以下代码克隆控件属性时会出错是为什么?

 
xfg6670197
一般會員


發表:1
回覆:0
積分:0
註冊:2004-05-07

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-05-07 16:16:56 IP:218.104.xxx.xxx 未訂閱
请问各位高手: 用以下代码克隆DBChart控件属性为什么会出错(其它控件我试过了没问题)?好像查找不到color,data source 等属性 uses typInfo; function CloneProperty2(SourceComp, TargetComp: TObject): Boolean; var i: Integer; Properties : PPropList; begin Result := True; try for i := 0 to GetPropList(SourceComp, Properties) - 1 do begin if LowerCase(Properties[i].Name) = 'name' then continue; if not IsPublishedProp(SourceComp, Properties[I].Name) then Continue; if not IsPublishedProp(TargetComp, Properties[I].Name) then Continue; if PropType(SourceComp, Properties[I].Name) <> PropType(TargetComp, Properties[I].Name) then Continue; case PropType(SourceComp, Properties[i].Name) of tkClass: SetObjectProp(TargetComp, Properties[i], GetObjectProp(SourceComp, Properties[i])); tkMethod: SetMethodProp(TargetComp, Properties[I], GetMethodProp(SourceComp, Properties[I])); else SetPropValue(TargetComp, Properties[i].Name, GetPropValue(SourceComp, Properties[i].Name)); end; end; except Result := False; end; end;
系統時間:2024-07-03 4:28:05
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!