for i:=0 to componentcount-1 do
begin if components[i] is edit then
tedit(components[i]).text:='';
//加分
begin if components[i] is edit then
tedit(components[i]).text:='';
//加分
解决方案 »
- 线程中调用DLL,长时间运行出先问题。
- 关于DBGridEh做记录多选的问题。希望高手近来指点一下
- 急急急,在线等。。。。。。分不够再加
- 想实现一些控件(如:Groupbox)的Canvas,搜索了一下论坛居然没有发现,只好提问了,给了思路或例子,谢谢!
- 怎么样将一张表里的内容取出做为另一张表的字段名?
- 请问:在INSTALLSHIELD8中给程序加上序列号?
- 帮忙!
- 求教"省<->市<->县<->乡镇"间数据传递、交换解决方案
- 我想让ListView 中的Check 框为只读,怎么办?
- 求成都市Delphi(or BCB,或愿意转用此两语言)程序员一名,不要求N年经验
- 在sql server7.0 有自动递增的字段类型?
- 为什么在winxp中有很多的api 函数不能用????
...
for i:=0 to 9 do
begin
strs.add(edtest[i].text);
end;
以上是创建了一个新类,可以用Honey_001的方法较简单.
for i:=0 to self.ComponentCount-1 do
if self.Components[i].ClassType=TEdit then
strs.Add(TEdit(Components[i]).Text);
for i:=1 to 10 do
strs.Add(TEdit(FindComponent('Edit'+IntToStr(i))).text);
begin
if (components[i].is tedit then
begin
tedit(components[i]).setfocus;
^^^^^^^^^^^
end;
end;
FEdits: array [0..9] of TEdit;
onCreate;
FEdits[0] := Edit1;
FEdits[1] := Edit2;
...use
for I ;= 0 to High(FEdits) do
ShowMessage(FEdits[I].Text);
var
sList:TStrings;
i:integer;
begin
sList:=TStringList.create; for i:=0 to form1.controls.count-1 do
begin
if form1.controls[i].classtype=tedit then
sList.addobject(Form1.controls[i]ClassName,TEdit(FOrm1.controls[i]));
end;
end;
在用的时候
Tedit(sList.object[1]).text:='ddd';