TRY
  STRTODATE(EDIT1.Text)
 EXCEPT
  SHOWMESSAGE ('ERROR')

解决方案 »

  1.   

    if column.field.asinter .... then
    begin
       Dbgrid1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
       Dbgrid1.Canvas.Brush.Color:=tempColor;
       Dbgrid1.Canvas.Font.Color:=tempColor2;
    end
      

  2.   

    在dbgrid的DrawColumnCell事件中写,以下是范例
    procedure TForm1.Dbgrid1DrawColumnCell(Sender: TObject;
      const Rect: TRect; DataCol: Integer; Column: TColumn;
      State: TGridDrawState);
    begin
      if Dbgrid1.datasource.dataset.FieldByName('Urgent').AsString='Y' then
        begin
          Dbgrid1.Canvas.Font.Color:=clred;
        end;
      Dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
    end;