Ver Mensaje Individual
  #2  
Antiguo 26-07-2016
Avatar de BDWONG
BDWONG BDWONG is offline
Miembro
NULL
 
Registrado: nov 2013
Posts: 113
Reputación: 11
BDWONG Va por buen camino
Hola buscando me econtre un enlace donde muestra como pintar una celda en especifico aqui te lo dejo http://stackoverflow.com/questions/6...in-string-grid


La prueba esta hecha en Lazarus 1.6 pero seguro servira igual en Delphi
Bueno y en base a la respuesta del usuario @RRUZ pues hize esto:

Código Delphi [-]
procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
  aRect: TRect; aState: TGridDrawState);
var
  i,j:Integer;
begin

  if (ACol >=1) and (ARow =StringGrid1.Row) then
    with TStringGrid(Sender) do
    begin
      //paint the background Green
      Canvas.Brush.Color := clBlue;
      Canvas.FillRect(aRect);
      Canvas.TextOut(aRect.Left+2,aRect.Top+2,Cells[ACol, ARow]);
    end;

  if (ACol = StringGrid1.Col) and (ARow = StringGrid1.Row) then
    with TStringGrid(Sender) do
    begin
      //paint the background Green
      Canvas.Brush.Color := clYellow;
      Canvas.FillRect(aRect);
      Canvas.TextOut(aRect.Left+2,aRect.Top+2,Cells[ACol, ARow]);
    end;
end;

Ejemplo:
https://www.youtube.com/watch?v=x5kb...ature=youtu.be
Responder Con Cita