如何设置?
解决方案 »
- 小弟刚开始学delphi,问个弱弱的问题,delphi2009如何新建windows forms application?....
- 关于twindowsmediaplayer的问题 急
- 求李颖的最新DBBackup控件下载!!!
- 什么地方有Delphi6.0的下载?
- printer.Canvas.TextOut打印自动换行的问题
- 无标题form的鼠标拖动代码?
- 一个的delphi新手的问题
- 如何设定默认的打印机,win2000中有个SetDefaultPrinter,但是Delphi好像不支持。
- 能不能给我提供delphi5(不是delphi6)的版本序列号
- !!!!!上午本来想散分的,散了200,不知道为什么可用分减了,帖子却不见,不知是什么原因?
- 请哪位大侠提供一个免费下载DELPHI第三方控件的网址啊!
- 初学delphi,买了DELPHI8,不过学习是用DELPHI7的书,有点问题不明?
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with DBGrid1.Canvas do
begin
if 你的条件 then
DBGrid1.Canvas.Brush.Color:= clBackground
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
inherited;
with DBGrid1 do
begin
if ((State = [gdSelected]) or (State=[gdSelected,gdFocused])) then
begin
Canvas.Font.Color :=ClYellow;
Canvas.Brush.Color :=ClNavy;
end
else
begin
if dmmain.ADOQKhsf.FieldByName('khbh').AsString='cw0001' then //条件
Canvas.brush.Color :=ClYellow;
end;
DefaultDrawColumnCell(Rect, DataCol, Column, State);// 这行很关键的,一定不要遗漏了
end;if gdSelected in State then //被选中行的颜色
begin
dbgrid.Canvas.Font.Color := clBlack;
dbgrid.Canvas.Brush.Color :=selectedcolor;
dbgrid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;