两个components不一样
第一个是TForm.Components
指form上的组件
第二个是TApplication.Components
指整个Application的组件!
快给分!
第一个是TForm.Components
指form上的组件
第二个是TApplication.Components
指整个Application的组件!
快给分!
解决方案 »
- 请教---------如何用CopyRect从图片中某区域存成另一个图片?
- delphi中多条件SQL语句的增加注意事项
- 如何手工换算unix时间戳
- 如何从右向左取最后一个字符?
- 买DELPHI代码,进来看看啊!
- 写了一个组件,其中的方法耗时大,且方法中有不能使用Application.ProcessMessages语句,有何解?如果我要加入进度条,如何加?
- record数组的内存拷贝用什么最好?
- 如何获取系统密码
- 用ADO连SQL SERVER,DATASET的RECNO正常,换用BDE后都是-1,怎么回事!!!!
- 怎么使DLL?
- timer定时器控件timertimer事件的使用问题
- 有谁知道深圳市奥尊电脑有限公司上海分公司的情况?
请再说清楚点。只有一个窗体的application.components和form.components有区别吗?
form.components不包含Form本身
你改的是Form的components,用application的话这样写:
if application.components[i] is TForm then
begin
if application.components[i] as TForm).Components[j] is TEdit
then
begin
(application.components[i] as TForm).Components[j] as TEdit).Caption := 'Text;'
end
end;
form.components不包含Form本身
你改的是Form的components,用application的话这样写:
if application.components[i] is TForm then
begin
if (application.components[i] as TForm).Components[j] is TEdit
then
begin
((application.components[i] as TForm).Components[j] as TEdit).Caption := 'Text;'
end
end;
它只包含了Form,而Label 是包含在Form中的,所以
TForm.Components[I] 才可能找到Label,Text呵呵,liuxiaowei(巍巍) ( 已讲得很清楚了