如果我有5个或更多的EDIT,只要其中一个为空就SHOWMESSAGE,要如何做呢?小弟是初学的,请各位大哥给小弟代码好吗??
解决方案 »
- delphi中导出的类中.如何导出属性(property)?
- 矩形中间随机取一个点
- 关于DBGridEh在xp下运行的问题
- 如何设置?listbox
- DLL的一个小问题...(给100分)
- 错误提示:dataset does not support bookmarts,which is required for....datacontrols
- 调用WinRAR时出现的问题
- 如何把数据库中的数据导入特定格式的Word文当中,特急,来者有分数。给100分!!!!!!!!!!!
- c#的webservice,Delphi的客户端,下载文件丢失的问题。
- 喝白开水有利身体健康之五
- 缓存更新多条记录出错,出现:'TOO many record on table ,too many open tables '提示,请问这是什么意思?
- 如何生成ICON文件!
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:=0 to ComponentCount-1 do
if Components[i] is TEdit then
if (Components[i] as TEdit).Text=''then ShowMessage('空');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
for I := 1 to 5 do
begin
if TEdit(FindComponent('edit'+inttostr(i))).Text = '' then
begin
ShowMessage('必须填入全部资料');
TEdit(FindComponent('edit'+inttostr(i))).SetFocus;
break;
end;
end;end;
var
i : integer;
begin
for i := 0 to Acontrl.ControlCount-1 do
begin
if ((Acontrl.Controls[i] is TEdit) and (((Acontrl.Controls[i]) as TEdit).Text = '') then showmessage('');
if Acontrl.Controls[i] is TCustomControl then
ClearEdit( (Acontrl.Controls[i] as TCustomControl))
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
ClearEdit(Panel2);
end;
var
i:integer;
begin
for i:=0 to componentcount -1 do
if components[i] is tedit then
if (components[i] as tedit).Text='' then
showmessage('你有一个或以上地方没有填');
break
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into plu (barcode,comname,price,saleprice,vipsaleprice)');
[Fatal Error] Unit1.pas(64): Internal error: T2335晕啊,,为何不能编译通过...这个T2335又是什么意思???
begin
if components[i] is tedit then
if (components[i] as tedit).Text='' then
begin
showmessage('你有一个或以上地方没有填');
break;
end
end;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into plu (barcode,comname,price,saleprice,vipsaleprice)');
flag : boolean;
begin
flag := true;
for i:=0 to componentcount -1 do
begin
if components[i] is tedit then
if (components[i] as tedit).Text='' then
begin
showmessage('你有一个或以上地方没有填');
flag := false;
break;
end
end;
if flag then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into plu (barcode,comname,price,saleprice,vipsaleprice)');
end;
end;