小弟初学delphi,请问如何实现如下的语句:
var i:integer;
i:=1; //或者其他的整数,2,3,...
edit[i].caption:='hello'; //也就是edit1.caption:='hello';i:=2,就是edit2.caption:='hello';请问这句该怎么写?
var i:integer;
i:=1; //或者其他的整数,2,3,...
edit[i].caption:='hello'; //也就是edit1.caption:='hello';i:=2,就是edit2.caption:='hello';请问这句该怎么写?
解决方案 »
- fastreport3.15控件预览时有时候出现接口错误,请高手指点是什么原因造成?
- 到哪里找“带左右箭头的splitter”控件?
- ?疑惑 ?SOS
- 菜鸟提问:函数的参数的默认值?在线等待。
- 求教:给家里装个监控摄像头,需要在远处网上能看到家里的情况
- 怎样才能把Edit.text 里面的字体偏右排列?
- 怎样逼迫edit1中输入数据是整型的?
- 如何获得dbgrid中记录的个数?
- 三个问题没解决,一共180分,想要把分平均分摊,想得分请见详情!
- 请问一个有关Socket的SendStream函数的问题
- 我想在一定时间内向一个IE窗口中的超链点击,大家有什么算法可提供?100分救解。
- FastReport中的frReport能实现自动纵向分页吗?如果不能有其他办法吗?Up有分!!!!
edit[i].caption:='hello';
你要一次性全改成这个。最多加个for循环~
var
i:integer;
begin
for i:=1 to 100 do
TEdit(Form1.FindComponent('Edit'+IntToStr(i))).Text:='hello';
end;Edit好象没有Caption,有Text
(FindComponent('edit2') as tlabel)='hello';
(FindComponent('edit2') as tlabel).caption='hello';
//Tedit是没有caption属性的
var i:integer;
begin
i:=1;
edit[i].caption:='hello';
end;出错为:Undeclared identifier:'edit'.
TEdit(Form1.FindComponent('Edit'+IntToStr(i))).Text:='hello';
这个行了。顺便问一下,我要将button1的1取出再放到变量i中,该怎么做呢?