FindComponent适用于知道组件的名字(对象),但是通过类的名字的话,好像有点不合适吧。 如果你保存的是edit1那么你可以这么判断 if application.findComponent('edit1') is TControl then showmessage('是TControl'); 如果你保存的是一种TEdit恐怕就不能用这个函数了。
向下面一样TFormClass = class of TForm;
Call FindClass to locate a class type by name. FindClass searches the classes that the streaming system knows about. Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered with the streaming system. Other classes can be registered (with a call to RegisterClasses) so that the streaming system will recognize that class in a stream and know how to construct it. If the requested class name cannot be found, FindClass raises an exception. --------------------------- 学习...
如果你保存的是edit1那么你可以这么判断
if application.findComponent('edit1') is TControl then
showmessage('是TControl');
如果你保存的是一种TEdit恐怕就不能用这个函数了。
向下面一样TFormClass = class of TForm;
---------------------------
学习...