改变DBGRID的选中行的颜色

默认DBGRID选中行的颜色为深蓝色,可以在程序中改变

在DBGRID的OnDrawColumnCell中写入

if (State=[gdSelectd..gdFocused,gdCurrent]) then

begin

   Grid.Canvas.Font.Color :=clRed;

   Grid.Canvas.Font.Brush.Color :=clInfor;

   Grid.DefaultDrawColumnCell(Rect,DataCol,Column,State);

end;

原文地址:https://www.cnblogs.com/djcsch2001/p/2097775.html