Z
zhnf2001
Unregistered / Unconfirmed
GUEST, unregistred user!
//-----帮助修改一下
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var i:integer;
begin
if ((adotable1.RecNo mod 4=0) and (adotable1.RecNo mod 4 =3)) then
(Sender as TDBGrid).Canvas.Brush.Color := clwhite //定义背景颜色
else // clinfobk 深黄
(Sender as TDBGrid).Canvas.Brush.Color :=clcream ; //淡黄
if ((State = [gdSelected]) or (State = [gdSelected, gdFocused])) then
if not DBGrid1.SelectedRows.CurrentRowSelected then
DBGrid1.Canvas.Brush.Color := clHighlight;
DBGrid1.Canvas.Pen.Mode := pmMask;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var i:integer;
begin
if ((adotable1.RecNo mod 4=0) and (adotable1.RecNo mod 4 =3)) then
(Sender as TDBGrid).Canvas.Brush.Color := clwhite //定义背景颜色
else // clinfobk 深黄
(Sender as TDBGrid).Canvas.Brush.Color :=clcream ; //淡黄
if ((State = [gdSelected]) or (State = [gdSelected, gdFocused])) then
if not DBGrid1.SelectedRows.CurrentRowSelected then
DBGrid1.Canvas.Brush.Color := clHighlight;
DBGrid1.Canvas.Pen.Mode := pmMask;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;