如何知道哪一个控件的基类是什么

Linux2001 2001-08-05 08:11:25
比如:Button1的基类是TButton,Label1的基类是TLabel!还有,TWinControl和TComponent有什么区别呢?
...全文
154 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
summernightrain 2001-08-11
  • 打赏
  • 举报
回复
看帮助,控件里面有一项叫做Hierarchy显示了该类的父类结构。
Linux2001 2001-08-11
  • 打赏
  • 举报
回复
谢谢
hpn_cao 2001-08-05
  • 打赏
  • 举报
回复
所有控件都继承于TComponent , 而TComponent TControl 的父类,TControl是TGraphicControl 和 TWinControl 的父类,TWinControl 又是我们用到的几乎所有控件的父类。
我猜你的意思是不是要得到控件所属类?TComponent有个ClassName的方法
如: Edit1.Text := Button1.ClassName ;
(当然你也可以点中控件按F1)
outer2000 2001-08-05
  • 打赏
  • 举报
回复
see your help
chechy 2001-08-05
  • 打赏
  • 举报
回复
Edit1.Text显示TButton?不懂。
Linux2001 2001-08-05
  • 打赏
  • 举报
回复
谢谢Chechy但是我问的意思是有没有什么语句可以得到比如Edit1.Text:=????)(Button1),然后Edit1.Text中显示的就是TButton呢?
Crob 2001-08-05
  • 打赏
  • 举报
回复
F1

看源代码
tikkypeng 2001-08-05
  • 打赏
  • 举报
回复
up
chechy 2001-08-05
  • 打赏
  • 举报
回复
TComponent是所有控件的基类。但是直接从TComponent继承德都是非可视控件。TControl是所有可视控件的基类,它从TComponent继承。TWinControl和TGraphicControl分别从TControl继承。它们的区别在于一个有Handle,一个没Handle。
向TButton是从TWinControl继承。
TLabel这是TGraphicControl继承。

5,386

社区成员

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

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