var
t:TFrmMain;
begin
if(self is TForm) then
begin
if(self.ClassType=tform) then
begin
ShowMessage('tform');
end
else if(self.classtype=TFrmMain) then
begin
ShowMessage('tform1');
end;
end;
end;
delphi中的is运算符可以判断对象是否继承自某一个类,classtype可以判断具体是哪个类。
最后
以上就是可耐楼房最近收集整理的关于Delphi中判断控件的详细类型的全部内容,更多相关Delphi中判断控件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复