Autor Beitrag
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 07.03.05 23:04 
kann ich eine listbox begrenzen also das maximal nur 5 einträge hinein kommen können???

finde nirgends diese option hilfe
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 08.03.05 00:46 
Nicht dass ich wüßte aber da du sowieso nichts direkt eintragen kannst, sondern das mit etwas programmcode machen musst, kannst du doch die Anzahl der Einträge mit der Eigenschaft Count abfragen und dann entsprechend reagieren.
Chilla111 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Di 08.03.05 10:44 
also so wie bei nem edit feld gibt es also net hm okay dann löse ich es anders thx
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 08.03.05 17:31 
Also per Code wäre das dann z.B.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Form1.ListBox1.Items.Add('Hallo Welt');
if Form1.ListBox1.Items.Count > 5 then begin 
while Form1.ListBox1.Items.Count > 5 do begin
Form1.ListBox1.Items.Delete(5)
end;

nur so mal als Bsp. kannst natürlich auch noch prüfen was du da alles löschst und so...

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Di 08.03.05 17:48 
Zeile 2 (die if-Anweisung) ist überflüssig.

Abgesehen davon würde ich vor dem Hinzufügen von Einträgen prüfen, ob die Grenze schon erreicht ist.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Do 10.03.05 18:27 
OK, war grad net ganz bei der Sache... :oops: