Ver Mensaje Individual
  #12  
Antiguo 04-10-2008
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 24
maeyanes Va por buen camino
Hola...

Para poder usar las etiquetas y la imagen, necesitas crear las variables que van a servir de referencia:

Código Delphi [-]
type
  TPanel1 = class(TPanel)
  private
    FLabe1: TLabel;
    FLabe2: TLabel;
    FImage: TImage;

    procedure Click(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

constructor TPanel1.Create(aOwner: TComponent);
begin
  inherited;
  FLabel1 := TLabel.Create(nil);
  with FLabel1 do
  begin
     Parent := Self;
     Caption := ID;
     Font.Name := 'Tahoma';
     Font.Size := 8;
     Font.Color := clBlack;
     Top := 0;
  end;
  FLabel2 := TLabel.Create(nil);
  with FLabel2 do
  begin
     Parent := Self;
     Caption := AUTOR;
     Top := 30;
  end;
  FImage := TImage.Create(nil);
  with FImage do
  begin
     Parent := Self;
     Align := alClient;
     Picture.LoadFromFile(FOTO);
     Stretch := True;
     Onclick := Click;
  end;
  Width := 200;
  Height := 200;
end;

destructor TPanel1.Destroy;
begin
  FLabel1.Free;
  FLabel2.Free;
  FImage.Free;
  inherited
end;

De esta forma ya podrás hacer referencia a la etiqueta que quieras y a la imagen...


Saludos...
Responder Con Cita