F
fuxin198311
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure DBGridEhDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if (TDBGridEH(Sender).DataSource.DataSet.RecNo Mod 2=0) then
TDBGridEH(Sender).Canvas.Brush.Color:=rgb(255,245,249)
else
TDBGridEH(Sender).Canvas.Brush.Color:=rgb(247,247,239);
if ((State = [gdSelected])or(State=[gdSelected,gdFocused]))then
with TDBGridEH(Sender) do
begin
Canvas.Brush.color:=rgb(210,234,249);
Canvas.Font.Color:=clBlack;
Canvas.Pen.Mode:=pmMask;
DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
我写成过程 在共公单元
错误提示: [Error] pubfunc.pas(30): Undeclared identifier: 'TRect'
[Error] pubfunc.pas(592): Undeclared identifier: 'rgb'
我引用的单元
uses
unit1,ADODB,Un_datamodule,StdCtrls,SysUtils,Dialogs,DBGridEhImpExp,
GridsEh,DBGridEh,Classes,Graphics;
我是实现dbgrideh的颜色的,因为多个窗口用到,就想写个公共过程
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if (TDBGridEH(Sender).DataSource.DataSet.RecNo Mod 2=0) then
TDBGridEH(Sender).Canvas.Brush.Color:=rgb(255,245,249)
else
TDBGridEH(Sender).Canvas.Brush.Color:=rgb(247,247,239);
if ((State = [gdSelected])or(State=[gdSelected,gdFocused]))then
with TDBGridEH(Sender) do
begin
Canvas.Brush.color:=rgb(210,234,249);
Canvas.Font.Color:=clBlack;
Canvas.Pen.Mode:=pmMask;
DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
我写成过程 在共公单元
错误提示: [Error] pubfunc.pas(30): Undeclared identifier: 'TRect'
[Error] pubfunc.pas(592): Undeclared identifier: 'rgb'
我引用的单元
uses
unit1,ADODB,Un_datamodule,StdCtrls,SysUtils,Dialogs,DBGridEhImpExp,
GridsEh,DBGridEh,Classes,Graphics;
我是实现dbgrideh的颜色的,因为多个窗口用到,就想写个公共过程