Ver Mensaje Individual
  #1  
Antiguo 18-02-2015
shoulder shoulder is offline
Miembro
 
Registrado: abr 2008
Posts: 441
Reputación: 19
shoulder Va por buen camino
Label - Image - Scrollbox

hola hice un programa con un scrollbox e image funciona bien pero no logro poner el label del nombre del archivo debajo de cada imagen busque pero no encontre ejemplo. Les paso como lo hice pero no acierto con el label.


Código Delphi [-]
procedure TForm1._CreateImages(imList: TStringList);
var
  im:TImage;
  i,cuentatop:Integer;
  pnl:TPanel;
  lbl: tlabel;
begin

  // Para cada imagen
  for i := 0 to (imList.Count - 1) do begin
    // Crear el control imagen
    im := TImage.Create(nil);
    lbl := TLabel.Create(nil);
    // Asignar propiedades
    im.Parent := ScrollBox1;
   im.Height := ScrollBox1.Height;
    im.AutoSize := True;
    im.Width := im.Height;
    im.Top := 0;
   im.Left := ((im.Width  + 15{panel} + 4) * i);

    im.Transparent := False;
    im.Align := alBottom;
    im.Stretch := True;
    im.Proportional := True;


    // Cargar
    im.Picture.LoadFromFile(imList[i]);

   // lbl.Left  :=  ScrollBox1.Height;;
  //  im.Picture.Bitmap.Canvas.TextOut(Lbl.Left, Lbl.Top,imList[i]);


    // vebto OnClick
  //  im.OnClick := ClickImage;
    // Añadirla a la lista de objetos



    oList.Add(im);



    lbl.Caption := imList[i];
    lbl.Parent := ScrollBox1;
    lbl.Align := alButtom;
   
    oList.Add(lbl);

    // Separados
    pnl := TPanel.Create(nil);
    pnl.Parent := ScrollBox1;
    pnl.Left := im.Left + 5;

    pnl.Left := im.Left + 5;
    pnl.Width := 15;

    pnl.Height := im.Height;

    pnl.Align := alLeft;
    pnl.Color := clBlack;

    // Aadirlo a la lista de objetos
    oList.Add(pnl);

  end;

  


end;

Última edición por Neftali [Germán.Estévez] fecha: 18-02-2015 a las 10:27:21. Razón: Corregir los Tags
Responder Con Cita