Autor Beitrag
hui1991
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Sa 03.06.06 20:39 
Wie kann ich eine TListBox erstellen.
Bei ich hab das geschrieben
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
  ListBox1: TListBox;
begin
  ListBox1.Create;
  try
    ListBox1.Items.Add('Hallo');
  finally
    ListBox1.free;
  end;
end;

Blos bei mir kommt fehler bei Create.
Kann mir jemand diesen ausschnitt in richtig mal geben.
Noch eine kleine Zwischenfrage nicht das es mich mal trifft: Wo kann ich die OH finden?

MfG
hui1991
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Sa 03.06.06 20:54 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
  ListBox1: TListBox;
begin
  ListBox1 := TListBox.Create; // so ändern
  try
    ListBox1.Items.Add('Hallo');
  finally
    ListBox1.free;
  end;
end;