在这个Field的OnSetText中可以这么做:
try
  StrToDate(Text);
  Sender.AsString := Text;
except
  // do you things
end;

解决方案 »

  1.   

    try
      ..
    except
      ShowMessage('你的自己的消息');
    end;
      

  2.   

     请 问 field 有onsettext 这 个  事 件 吗? 如 何 调 用? 谢 谢
      

  3.   

    在dbedit的onexit事件中加入try...expect语句
      

  4.   

    当然有了,你双击你的Table或者Query控件,然后再出来的对话框中点右键,选择Add all Fields...,然后点钟相应的Field,在Object Inspector的Event栏就有了。