unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 =
class(TForm)
ListBox1: TListBox;
Button1: TButton;
Label1: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
FTest :
String;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
ListBox1.Items.AddObject('
Test',@FTest);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FTest:='
Dies ist ein Test';
end;
procedure TForm1.Button2Click(Sender: TObject);
var
S : Pointer;
begin
S:=ListBox1.Items.Objects[ListBox1.ItemIndex];
Label1.Caption:=String(S^);
end;
end.