我定义了两个重载函数如下:
//判断编辑框信息不能为空 for Example :if IsEmptyEdit(Edi1,'注意','商品代码不能为空') then Exit
function IsEmptyEdit(Edit:TEdit;sShowText,sShowCaption:String):Boolean;overload;
begin
Result:=False;
if (Edit.ClassName='TEdit') or (Edit.ClassName='TDBEdit') then
begin
if Edit.Text='' then
begin
Application.MessageBox(PChar(sShowText+'信息不能为空!'),PChar(sShowCaption),MB_ICONINFORMATION+MB_OK);
Result:=True;
Edit.SetFocus ;
Exit;
end;
end;
end;function IsEmptyEdit(Edit:TDBEdit;sShowText,sShowCaption:String):Boolean;overload;
begin
Result:=False;
if (Edit.ClassName='TDBEdit') then
begin
if Edit.Text='' then
begin
Application.MessageBox(PChar(sShowText+'信息不能为空!'),PChar(sShowCaption),MB_ICONINFORMATION+MB_OK);
Result:=True;
Edit.SetFocus ;
Exit;
end;
end;
end;
我在使用时:
if IsEmptyEdit(DBEdit_Name,'行政区名称不能为空!','注意') then exit;
DBEdit_Name 是TDBEdit类型,这使用是正确的
当使用
if IsEmptyEdit(Edit_UnitName,'单位','提示') then Exit;
就出错了,Edit_UnitName:Tedit
There is no overloaded version of 'IsEmptyEdit' that can be called with these arguments
这里哪里出错了?求救!!!!
//判断编辑框信息不能为空 for Example :if IsEmptyEdit(Edi1,'注意','商品代码不能为空') then Exit
function IsEmptyEdit(Edit:TEdit;sShowText,sShowCaption:String):Boolean;overload;
begin
Result:=False;
if (Edit.ClassName='TEdit') or (Edit.ClassName='TDBEdit') then
begin
if Edit.Text='' then
begin
Application.MessageBox(PChar(sShowText+'信息不能为空!'),PChar(sShowCaption),MB_ICONINFORMATION+MB_OK);
Result:=True;
Edit.SetFocus ;
Exit;
end;
end;
end;function IsEmptyEdit(Edit:TDBEdit;sShowText,sShowCaption:String):Boolean;overload;
begin
Result:=False;
if (Edit.ClassName='TDBEdit') then
begin
if Edit.Text='' then
begin
Application.MessageBox(PChar(sShowText+'信息不能为空!'),PChar(sShowCaption),MB_ICONINFORMATION+MB_OK);
Result:=True;
Edit.SetFocus ;
Exit;
end;
end;
end;
我在使用时:
if IsEmptyEdit(DBEdit_Name,'行政区名称不能为空!','注意') then exit;
DBEdit_Name 是TDBEdit类型,这使用是正确的
当使用
if IsEmptyEdit(Edit_UnitName,'单位','提示') then Exit;
就出错了,Edit_UnitName:Tedit
There is no overloaded version of 'IsEmptyEdit' that can be called with these arguments
这里哪里出错了?求救!!!!
解决方案 »
- delphi如何编程实现将应用程序创建快捷方式到windows启动菜单
- Delphi如何去获取SQL 2K的所有客户建立的表名啊?谢谢!
- 如何运行word的宏?
- 那位老哥帮我下载个小东西。50分相送。
- 高分请教ServerSocket和ClientSocket通信的问题,请高手看看,很详细。
- 新手:安装包的问题!
- Access violation at address 004E1A54 in module 'TSGL_P.exe'
- 求教delphi中DLL 函数的声明问题
- 如何将一个文本文件加入到exe文件中,程序运行时,并对文本文件操作!
- 我机器上的odbc的版本和我同事机器上的一样都是3.520.4403.2,可是我的是英文版,我同事的却是中文版??????
- adotable+dbgrid,怎么让它按某字段排序显示?
- 求教
begin
Result:=False;
if (Edit.ClassName='TEdit') or (Edit.ClassName='TDBEdit') then
begin
if Edit.Text='' then
begin
Application.MessageBox(PChar(sShowText+'信息不能为空!'),PChar(sShowCaption),MB_ICONINFORMATION+MB_OK);
Result:=True;
Edit.SetFocus ;
Exit;
end;
end;
end;