Ver Mensaje Individual
  #2  
Antiguo 20-12-2004
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.288
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Debes utilizar el evento DrawCell para pintar la celda, ya que es el adecuado para ello; En todo caso en el PopupMenu lo que debes hacer es activar/desactivar un flag que te marque si se pinta el bitmap o no.

En el DrawCell coloca un código como éste:
Código Delphi [-]
var
  bmp:TBitmap;
begin
  //Flag para saber si pinto la imagen (iniciualmente FALSE)
  if (not MustPintar) then begin
    Exit;
  end;
  // Coumna que quiero pintar
  if (ACol <> 1) then begin
    Exit;
  end;
 
  // Crear
  bmp := TBitmap.Create();
  // proteccon
  Try
    // Asignar la imagen
    ImageList1.GetBitmap(0,bmp);
    // pintarla
    StringGrid1.Canvas.Draw(Rect.Left + 2, Rect.Top + 2, bmp);
  finally
    bmp.Free;
  end;

Luego en tu popupmenu añades un código como éste:

Código Delphi [-]
  MustPintar := not MustPintar;
  StringGrid1.Repaint;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita