Ver Mensaje Individual
  #2  
Antiguo 27-02-2009
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.329
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
Cuando creas el TImage asígnale como owner tu objetoTGraphBlock

Código Delphi [-]
  ...
  image := TImage.Create(Self);

Cuando quieras acceder al objeto contenedor, basta con que accedas a esa propiedad.

Código Delphi [-]
var
  gb:TGrapkBlock;
begin
...
with Sender as TImage do begin
  // Cómo podría acceder ahora al dato si tengo una referencia 
  // al Timage, no al objeto del tipo TgraphBlock
  if (TImage(Sender) is TgraphBlock) then
    gb := TGraphBlock(TImage(Sender).Owner;
    ...
  end;
end;
__________________
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