Ver Mensaje Individual
  #5  
Antiguo 31-07-2010
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
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.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 31-07-2010 a las 22:51:06.
Responder Con Cita