如何知道一个对象是从TWinControl继承下来的?

yancey 2005-02-03 02:44:44
for i:=0 to TForm(Sender).ControlCount-1 do
begin
//如果 TForm(Sender).Controls[i] 是从TWinControl继承下来的...
end;


这句怎么写呀?
...全文
81 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly_liuyang 2005-02-03
  • 打赏
  • 举报
回复
Is语句判定

http://lysoft.7u7.net
jialiuer 2005-02-03
  • 打赏
  • 举报
回复
for i:=0 to self.ControlCount-1 do
begin
if self.Controls[i] is TWinControl then
showmessage(self.Controls[i].ClassName + '是从TWinControl继承来的');
end;
试试吧
Kevin_Lmx 2005-02-03
  • 打赏
  • 举报
回复
TForm(Sender).Controls[i].InheritsFrom(TWinControl)...
bee2518 2005-02-03
  • 打赏
  • 举报
回复
TForm(Sender).Controls[i] is TWinControl
王集鹄 2005-02-03
  • 打赏
  • 举报
回复
for i:=0 to TForm(Sender).ControlCount-1 do
begin
if TForm(Sender).Controls[i] is TWinControl then
{ TODO }
end;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧