请问TComponent的问题 !
我在ScrollBox上放了一些控件,现在想得到控件的个数
用
ScrollBOX1.ComponentCount为什么返回的总是 0?
问题点数:0、回复次数:4Top
1 楼outer2000(天外流星)回复于 2003-12-03 18:02:20 得分 0
showmessage(inttostr(scrollbox1.ControlCount ))Top
2 楼Cipherliu(孤鹰)回复于 2003-12-03 18:24:00 得分 0
ComponentCount是它拥有的控件,你放在窗体上的控件的拥有者是窗体.Top
3 楼47522341(睡到8:30)回复于 2003-12-03 19:27:05 得分 0
我也有同样的问题;
按照delphi帮助中的解释;
The ComponentCount of a component contains the same number of items as in the Components list for that component,
说componentcount属性是在某个控件的控件列表下的控件的条数;
我甚至先在另外一个事件中将一些控件的parent用代码设置了;但是还不行;
在显示的时候仍然是零;
Top
4 楼47522341(睡到8:30)回复于 2003-12-03 19:30:03 得分 0
用顶楼的controlcount属性倒是可以;
注释中说:Read ControlCount when iterating over all the children of this control. The children of the control are listed in the Controls property array.
这个跟component有什么区别;?Top
相关问题
- TComponent类
- 关于 virtual __fastcall TForm1(TComponent* Owner);
- __fastcall TForm1::TForm1(TComponent* Owner)是干啥用的
- 讨论:TComponent::Owner是怎么实现的?
- 请问:Tcontrol 与 Tcomponent 的区别
- 如何将string转换成TComponent,在线守候!!!
- 为什么在TComponent的派生类中无Create方法?
- 已知一个TComponent类指针,能否知道这个类的类名?
- __fastcall TForm1::TForm1(TComponent* Owner)这个方法有什么用,在做哪方面功能时才用它。
- 是否可以在线程中构建TidTcpClient?构造函数需要一个TComponent对象,这是为什么?




