Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Do 22.09.05 12:00 
Ich möchte alle markierten Einträge in meiner ListBox löschen.
Mit meinem Source wird immer nur der erste Eintrag gelöscht.
Wo ist dort der Fehler?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.LoeschenClick(Sender: TObject);
var i:integer;
begin
for i:=Liste.Items.Count-1 downto 0 do
    if Liste.Selected[i] then Liste.Items.Delete(i);
end;



Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Do 22.09.2005 um 13:16
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Do 22.09.05 12:15 
Gute Frage, bei mir funktioniert der Source wunderbar (Delphi 7 Personal) :nixweiss: Daran wirds also wohl nicht liegen.

_________________
JSXGraph
chaosben
Hält's aus hier
Beiträge: 10

Win 7 Professional 64bit
Delphi 2009 Professional
BeitragVerfasst: Do 22.09.05 12:20 
user profile iconraziel hat folgendes geschrieben:
bei mir funktioniert der Source wunderbar (Delphi 7 Personal)

Geht mir genauso.

Mal ne ganz alberne Frage: Du hast Multiselect auf "true"? :tongue:

_________________
visit TheUnknownOnes
kde2005
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45


D5 Pro,D2k5 PE
BeitragVerfasst: Do 22.09.05 12:20 
Hi!

ListBox1.Items.Clear(); :lol:

Gruß Konstantin

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.


Zuletzt bearbeitet von kde2005 am Do 22.09.05 12:21, insgesamt 1-mal bearbeitet
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Do 22.09.05 12:21 
Das bringt nur was, wenn alle markiert sind, aber es sollen ja nur die markierten gelöscht werden ;)

_________________
JSXGraph
kde2005
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45


D5 Pro,D2k5 PE
BeitragVerfasst: Do 22.09.05 12:25 
also bei mir funktioniert der Code auch!
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 22.09.05 13:01 
eventuell mit while

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  I: Integer;
begin
  I := Liste.Count-1;
  while I>=0 do
  begin
    if Liste.Selected[I] then Liste.Items.Delete[I];
    Dec(I);
  end;
end;
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Do 22.09.05 13:37 
Arrrrg....
Mit einer ListBox geht es wunderbar mein Code aber ich habe die FlatListBox Combonente benutzt und dort geht es nicht.
Ach wie ärgerlich.