可不可以写很少的代码就清除窗体中所有TEdit中的文字,而不需写Edit1.text:='';Edit2.Text:='';.............
解决方案 »
- 怎么安装自己编写的控件?
- 有关QUERY的纪录数的一段代码,我把recordCount赋给edit.text,怎么显示是-1。请高手指点。
- 如何在dbgrid第一列中显示一列的单选按钮????
- 关于delphi问题
- 用delphi存取图像的问题
- 居然出现这样的问题,熟悉sndplaysound函数的高手请帮忙!!!
- 发现了一个界面非常漂亮而且非常实用的客户关系管理软件
- 困扰了小弟一个晚上,请高手指教。
- Stream.WaitForData(60000)里执行时获得的流为什么为空?
- 请问选用哪本书?
- 我用ado做的数据库软件,现在进入打包阶段。发现在别的新的机器上运行时,就有一个问题...
- 如何添加窗体
edit[i]?
不行啊~
begin
for i:= 0 to form1.componentcount-1 do //不好意思componentcount记不太清!!
if components[i] is Tedit then //遍历窗体的所有控件,并判断是否是Tedit类型的.
(components[i] as Tedit).text:='';//如果是则把它清空
end;如果错误,真的很抱歉!!!但是基本上是这样.
begin
if Components[i] is TsuiEdit then
(Components[i] as TsuiEdit).Text := '';
if Components[i] is TsuiCheckBox then
(Components[i] as TsuiCheckBox).Checked := False;
if Components[i] is TsuiCheckListBox then
(Components[i] as TsuiCheckListBox).Items.Clear;
end;
var
i:integer;
begin
for i:=0 to form1.ComponentCount-1 do
if Components[i] is tedit then (components[i] as tedit).Text:='';
end;
if Components[i] is tedit then (components[i] as tedit).Text:='';
var
i: Integer;
begin
for i:=1 to 2 do
TEdit(FindComponent('Edit'+IntToStr(i))).Clear;
end;
begin
if Components[i] is TsuiEdit then
(Components[i] as TsuiEdit).Text := '';
if Components[i] is TsuiCheckBox then
(Components[i] as TsuiCheckBox).Checked := False;
if Components[i] is TsuiCheckListBox then
(Components[i] as TsuiCheckListBox).Items.Clear;
end;