Ver Mensaje Individual
  #2  
Antiguo 12-11-2024
Avatar de newtron
[newtron] newtron is offline
Membrillo Premium
 
Registrado: abr 2007
Ubicación: Motril, Granada
Posts: 4.214
Reputación: 24
newtron Va camino a la fama
Este es un código que tengo sobre un componente nuestro que deriva del StringGrid así que podrás interpretarlo fácilmente


Código Delphi [-]
procedure TFormManejaVerifactu.NTStringGrid3DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  SelectedPicture: TBitmap;
begin
  // Resultados del envío: 0=Enviado 1=No enviado(errores) 2=Enviado con errores
  if NtStringGrid3.RowCount <2 then
    exit;
  with Sender as TStringGrid do begin

    if NtStringGrid3.ValorCeldaPorCampoYFila('RESULTADO',ARow)<>'' then begin
      if (ACol=0) then begin
        if NtStringGrid3.Cells[0,ARow]<>'' then begin
          SelectedPicture:=TBitmap.Create;
          If NtStringGrid3.Cells[0,ARow]='0' then begin
            ImageList.GetBitmap(0, SelectedPicture);
          end else if NtStringGrid3.Cells[0,ARow]='1' then begin
            ImageList.GetBitmap(1, SelectedPicture);
          end else if NtStringGrid3.Cells[0,ARow]='2' then begin
            ImageList.GetBitmap(2, SelectedPicture);
          end;
          NtStringGrid3.Canvas.Draw(Rect.Left-2, Rect.Top, SelectedPicture);
          SelectedPicture.Free;
        end;
      end;
    end;

  end;

end;


Saludos.
__________________
Be water my friend.
Responder Con Cita