如何清空窗体(Form)上的所有Edit框??
解决方案 »
- fstream和iostream之类的读写文件操作是会将文件内容全都放到内存中么?
- 如何把DLL上的变量回传到主调程序的EDIT1.TEXT中.
- 在使用IdTCPServer、IdTCPClient编程时,服务器端如何及时监测到客户端已意外断掉
- z39.50服务器的详细资料或书,谁有?本人想编程序从该服务器下marc数据
- FastReport报表如何设置页面尺寸为16K
- delphi中如何调用sql server的dts动态库
- 讨论有关短信SP相关的东西!
- 数据库访问的"Access violation",莫名其妙......
- 菜鸟提问:请教诸位前辈,怎样能更快的学好delphi
- 我有100个button,要响应click事件,1个1个做太占资源,该怎么办?
- 今日开始学习delphi,大家捧捧场,散分!
- 这种情况下如何筛选
var
i:integer;
begin
for i:=0 to Form1.ControlCount-1 do
if Form1.Components[i] is TEdit then
TEdit(Components[i]).Text:='';end;
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
TEdit(Components[I]).Clear;
end;
procedure ClearAllEdits;
var i:Integer;
begin
for i:=Form1.ComponentCount-1 downto 0 do
begin
if Components[i] is TEdit then
TEdit(Components[i]).Free;
end;
end;
//注意:这里的EDIT控件要是动态创建的,我不保证不是动态创建的EDIT也可以(没试过)
procedure TForm1.Button2Click(Sender: TObject);
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
TEdit(Components[I]).Clear;
end;
請空EDIT的内容
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Form1.ControlCount-1 do
if Form1.Components[i] is TEdit then
TEdit(Components[i]).Text:='';end;
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
(Components[I] as Tedit).Clear;
end;
var intI:integer;
begin
for intI:=0 to Form1.ControlCount-1 do
if Form1.Components[intI] is TEdit then
TEdit(Components[intI]).clear;
end;