Einzelnen Beitrag anzeigen

DelphiKlaus

Registriert seit: 18. Okt 2006
100 Beiträge
 
Delphi 6 Professional
 
#2

Re: Abfage einer FileListbox auf doppelte dateien

  Alt 2. Aug 2007, 07:10
Hallo,

wenn, dann vielleicht so:

Delphi-Quellcode:
  if FileListBox1.Items.IndexOf (FileListbox1.Items [FileListBox1.ItemIndex]) then
    MessageDlgPos ('Datei vorhanden', mtInformation, [mbOk], 0, 290, 300);
Dann wird aber nur überprüft, ob der angewählte Eintrag doppelt vorkommt. Wenn Du alle doppelten haben willst:

Delphi-Quellcode:
  for Loop1 := 0 to Pred (FileListBox1.Items.count) do
    for Loop2 := Succ (Loop1) to Pred (FileListBox1.Items.count) do
      if FileListBox1.Items.IndexOf (FileListbox1.Items [Loop2]) <> Loop2 then
        MessageDlgPos ('Datei vorhanden', mtInformation, [mbOk], 0, 290, 300);
Habs nicht getestet; aber so in etwa sollte es gehen.

Viele Grüße

Klaus
  Mit Zitat antworten Zitat