procedure TForm1.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if cds2.FieldByName('促销状态').AsString='执行' then
begin
DBGrid2.Canvas.Font.Color := clgreen;
DBGrid2.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
与
procedure TForm1.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if cds1.FieldByName('促销状态').asstring='执行' then
begin
DBGridEh1.Canvas.Font.Color := clgreen;
DBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;为什么上面代码中DBGrid中能够通过,在DBGridEh中就不行呢?
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if cds2.FieldByName('促销状态').AsString='执行' then
begin
DBGrid2.Canvas.Font.Color := clgreen;
DBGrid2.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
与
procedure TForm1.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if cds1.FieldByName('促销状态').asstring='执行' then
begin
DBGridEh1.Canvas.Font.Color := clgreen;
DBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;为什么上面代码中DBGrid中能够通过,在DBGridEh中就不行呢?
解决方案 »
- types of actual and formal var parameters must be identical
- delphi中使用汇编伪指令ORG
- 高分讨论:Windows下如何通过一个已经建立的端口收发数据
- access 文件正在使用中。 有办法只读正在使用的Access文件吗?
- fastreport 3.5,关于自定义纸张大小的问题
- 各位高手帮帮我呀要不然我就死惨了//////关于一个存储过程调用的问题
- 那位大侠用过DEV的控件?有关ExpressBars的问题!急急急急急!!在线等待!多少分随你要!
- 怎条控制光标在edit中的位置!
- 求助给几个读取xml的简单例子
- 5和6版的DELPHI可以同时安装么????
- windows服务程序无法显示界面.在线等.
- 强!强!强贴!![转贴]“房价跟美国接轨,工资跟非洲接轨”
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if DBGridEh1.DataSource.DataSet.FieldByName('在职类别').AsString='试用职员' then
DBGridEh1.Canvas.Brush.Color := $00FFECD9
else if DBGridEh1.DataSource.DataSet.FieldByName('在职类别').AsString='正式职位' then
DBGridEh1.Canvas.Brush.Color :=clWindow
else if DBGridEh1.DataSource.DataSet.FieldByName('在职类别').AsString='离职人员' then
DBGridEh1.Canvas.Brush.Color := clMenuBar;
DBGridEh1.Canvas.Font.Color := $00F77B00;
DBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;