Autor Beitrag
bruder jonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Do 15.05.03 13:28 
hallo,

ich habe eine listbox. wenn ich ein element auswähle und danach auf einen button drücke, soll das element aus der listbox gelöscht werden.

wie geht das?

wie kriege ich es hin, das dann die listbox aktualisiert wird??

danke
Simon Joker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236
Erhaltene Danke: 1



BeitragVerfasst: Do 15.05.03 13:30 
Hi
ausblenden Quelltext
1:
ListBox1.Items.Delete(ListBox1.ItemIndex);					
bruder jonas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Do 15.05.03 14:33 
Titel: danke, kannst du das auch für die datenbank erklären
wenn ich den selektierten listbox eintrag aus der datenbank löschen möchte (ttable)

danke
Sliver
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Sa 21.06.03 22:15 
Wie kann man die ganze Auswahl löschen, also wenn man mehere Einträge markiert hat? Und wie kann man nachdem man gelöscht hat den ersten Eintrag selektieren.

cu Sliver
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:22 
ausblenden Delphi-Quelltext
1:
2:
for x:=0 to count(Listbox1.Items) do
  if Listbox1.Selected[x] then Listbox1.Items.Delete(x);

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 21.06.03 22:28 
Schon die Delphi Hilfe gefunden? Nein? Dann wird es aber mal Zeit.

Öffne mal die Hilfe und gib im Index "TListbox" ein, dann klickst du mal auf den Eintrag TListbox und dann kuckst du mal, ob du nicht unter Methods (bzw. Methoden) oder Properties (bzw. Eigenschaften) was passendes findest.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 21.06.03 22:30 
Tweafis hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
for x:=0 to count(Listbox1.Items) do
  if Listbox1.Selected[x] then Listbox1.Items.Delete(x);

Einfachher:
Zitat:

ausblenden Delphi-Quelltext
1:
procedure DeleteSelected; override;					

Description
Call DeleteSelected to delete the selected items from the list box.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:31 
Nicht gesehen... ;) Aber wenn er net selber draufkommt... Ich hab halt kurz was zusammengeschustert ;)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Sliver
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Sa 21.06.03 22:33 
Ich benutze die Hilfe schon aber diesesmal habe ich den Befehl
ListBox1.DeleteSelected; übersehen. Werde das nächste mal etwas genauer schauen bevor ich nachfrage, aber Danke.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:34 
Hmm, ich kann das auch nirgends finden *blindist* :|

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:35 
Bei mir gibt es gar kein TListbox.DeleteSelected (D5 Prof)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 21.06.03 22:37 
Bei D6 Personal schon. :roll:
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:37 
Und woher soll ich das wissen? Sorry, wenn ich das umständlichere geposted habe, aber bei mir gibts das halt nicht :roll:

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 21.06.03 22:40 
Ich mache dir ja keine Vorwürfe. Bei D6 Personal gibt es eben eine einfachere Methode.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 21.06.03 22:51 
Dann ist es ja gut, hab wohl den :roll: smilie falsch verstanden ;)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 21.06.03 22:58 
Der -> :roll: bezog sich auf die Tatsache, dass D6 mal wieder mehr kann als D5 und es in der Hilfe nicht gekennzeichnet ist. Das wäre mal eine Innovation, wenn Borland in der Hilfe die die version angeben würde, ab wann was verfügbra ist.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: So 22.06.03 06:59 
Dann ist es ja gut :D

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.