比如当前窗体里面是否存在TDBGridEh控件.

解决方案 »

  1.   


       if (mainfrm.Components[i] is TDBGridEh) then  //判斷是否是TDBGridEh控件.
      

  2.   

    不对吧?  for i:=0 to Self.ComponentCount-1 do
        if Self.Components[i] is TDBGridEh then你不走循环吗?其实我用循环倒是已经写出来了,不过感觉效率可能不好,我不知道有没有不走循环直接可以用的函数什么的...
      

  3.   

    对象都是存在TComponent的List里,TComponent自身查找时也是查找List里的,估计没有其它直接的方法.