Hola flystar,
Neftalí se refiere a hagas lo siguiente:
. Crees un campo calculado "tbPintar" por Ej. y pongas la propiedad del DBGrid: Options -> dgRowSelect igual a True.
. En el evento OnDblClick Pones a True tbPintar. (1)
. Pintas en el evento OnDrawColumnCell. (2)
(1)
Código:
procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin
tb.Edit;
tbPintar.Value:= True;
end;
(2)
Código:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if gdSelected in State then
with DBGrid1 do
begin
if tbPintar.Value then // color azul, fondo blanco
begin
Canvas.brush.Color:= clBlue;
Canvas.Font.Color:= clWhite;
end
else // color por defecto del DBGrid
begin
Canvas.Brush.Color:= clWindow;
Canvas.Font.Color:= clBlack;
end;
DefaultDrawColumnCell(Rect, DataCol, Column, State); // pintar
end;
end;
Saludos.