Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以在运行时知道组件的类别。例如,如果我有一个 TLabel,它的类别是标准,这意味着组件 TLabel 在标准工具面板中。
我需要它来检查组件是否是我自己的创作之一,因为我有很多新组件,我不想检查很多 ifs 条件......
谢谢
组件安装到工具面板的类别由对 RegisterComponent 的调用确定,RegisterComponent 本身通常是 Register 过程的一部分。此注册过程在安装设计时包时从 IDE 中调用。
简而言之:几乎没有希望在运行时找到类别,因为它没有绑定到组件本身。相反,它是 IDE 的更多信息,因此仅在此处处理。