Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
技术板块灌水区
» 关于GetPropInfo和SetPropValue的用法疑问
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 关于GetPropInfo和SetPropValue的用法疑问
jxydhzw
普通灌水员
UID 3904
Digest Posts
1
Credits 64
Posts 19
点点分 64
Reading Access 10
Registered 2006-12-26
Status Offline
#1
Post at 2008-8-29 12:53
Profile
|
Blog
|
P.M.
关于GetPropInfo和SetPropValue的用法疑问
关于GetPropInfo和SetPropValue的用法疑问
这几天在用 Dev系列的控件,比如 TcxComboBox
的确很强大.但是开发中遇到些问题.比如动态设定其属性的问题
因为这些控件有些属性是在嵌套属性当中.比如TcxComboBox的
ReadOnly属性是在其Properties属性里的.这下动态设置起来就麻烦了
之前一些属性仅仅这样就可以了
SetPropValue(FindComponent('edit1'),'ReadOnly','True');
就搞定了.但是它们的嵌套怎么搞?
我试过
SetPropValue(FindComponent('cxcmbList1'),'Properties.ReadOnly','True');
这样不行.报"Property Properties.ReadOnly does not exist"这个错.
不知道有朋友知道怎么设法吗?
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2008-8-29 13:43
Profile
|
Blog
|
P.M.
参考CnPack组件包的CnCommon单元里头的级联属性操作相关函数。
如:
function GetPropInfoIncludeSub(Instance: TObject; const PropName: string;
AKinds: TTypeKinds = []): PPropInfo;
{* 获得级联属性信息}
function GetPropValueIncludeSub(Instance: TObject; PropName: string;
PreferStrings: Boolean = True): Variant;
{* 获得级联属性值}
function SetPropValueIncludeSub(Instance: TObject; const PropName: string;
const Value: Variant; AOwner: TComponent = nil): Boolean;
{* 设置级联属性值}
procedure DoSetPropValueIncludeSub(Instance: TObject; const PropName: string;
Value: Variant; AOwner: TComponent = nil);
{* 设置级联属性值,不处理异常}
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-24 10:05
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.011399 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats