tryexceptionend;
来判断。运行时脱离delphi就没有错误提示了

解决方案 »

  1.   

    在该控件的keypress中限定一下:
    if not (key in ['0'..'9',#8]) then
       key:=#0;
    设置它的值例如:minvalue:=0,maxvalue:=999999,这样就只能输入或选择正数了
    在delphi运行环境中确实有问题,但脱开环境就没有问题了。这可能是delphi的一个bug了。                 
      

  2.   

    procedure TForm1.SpinEdit1Exit(Sender: TObject);
    begin
      if Spinedit1.Text = '' then
        Spinedit1.Value:= 0;
    end;
      

  3.   

    to ChocoboY(陆行鸟):我开始用的是
     if Spinedit1.Text = '' then
        Spinedit1.Value:=100;
    现在好了,或许我修改时不小心发生了错误.谢谢!!!