Einzelnen Beitrag anzeigen

Benutzerbild von Harry Stahl
Harry Stahl

Registriert seit: 2. Apr 2004
Ort: Bonn
2.479 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: ListBox füllen

  Alt 23. Jul 2014, 20:08
Also unter XE5, Update 2 funktioniert der Code:

Delphi-Quellcode:
unit Unit55;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
  FMX.Layouts, FMX.ListBox;

type
  TForm55 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form55: TForm55;

implementation

{$R *.fmx}

type
  TFileInfo = record
    FileName: string;
    Info: string;
  end;

procedure TForm55.Button1Click(Sender: TObject);
var I : Integer;
  FF : array of TFileInfo;
begin
  SetLength(FF,5);
  FF[0].FileName:='a.kml';
  FF[1].FileName:='b.kml';
  FF[2].FileName:='c.kml';
  FF[3].FileName:='d.kml';
  FF[4].FileName:='e.kml';
  for I := Low(FF) to High(FF) do
    ListBox1.Items.add(FF[i].FileName);
end;

end.
wie er soll, siehe anliegenden Screenshot vom Samsung-Device.
Miniaturansicht angehängter Grafiken
2014-07-23-21-07-49%5B1%5D.jpg  
  Mit Zitat antworten Zitat