使用
 try
...
 except
...(屏蔽语句)
 end;限定在edit中只能输入数字可以找找这方面的空件,也可编代码:procedure PressInt( var Key: Char;pPlace:string);
begin
  if (not(key in['0'..'9','.',#8])) then
    key:=#0;//退格
end;

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/961/961864.xml?temp=.8942377
      

  2.   

    建议MASK中多用9,少用0。在空件状态变化时对输入内容进行判断就可以了,这样不会引起异常,用户使用时会感到很方便。取值和复值可以写成通用过程,很方便
      

  3.   

    在form的Create事件
     application.onexception:=Findexcept;建立Findexcept过程
      Procedure TExceptionHandle.Findexcept(Sender:Tobject;E: Exception);
    begin
    showmessage('发生错误');
    end;
      

  4.   

    限定在edit中只能输入数字
    procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
    begin
    if not (Key in ['0'..'9']) then Key:=#0;
    end;