我想判断一个component是否有left属性,请大侠门帮帮我(50分)

H

hebohb

Unregistered / Unconfirmed
GUEST, unregistred user!
我想判断一个component是否有left属性,请问高手们应该怎么写
 
try
xx.left=1;
except
showmessage('no left');
end;
 
uses typinfo;

var
p:pPropInfo;
begin
p:=GetPropInfo(Memo1.ClassInfo,'Left');
if p=nil then showmessage('No Left')
else ShowMessage('Left');
p:=GetPropInfo(Button1.ClassInfo,'Left');
if p=nil then showmessage('No Left')
else ShowMessage('Left');
end;
 
to michael.ma
我要的不是跳过错误的方法啊
 
谢谢 Dinky ,你的方法我试过了,可以啊
 
顶部