Autor Beitrag
Friedhelm
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 10.12.02 19:24 
Hallo zusammen,

ich möchte die Anzahl selektierter Einträge in einer Listbox spontan in einem Label sehen. In der Mouse down-Routine der Listbox habe ich folgendes stehen:
ausblenden Quelltext
1:
2:
3:
 if Sparte.listbox67.selected[j] = true then
            begin
            sparte.Label219.Caption;

dann kommt die Fehlermeldung ...überschreitet ...

Geht das so nicht? Wer kann mir weiterhelfen? Danke für die Hilfe.

Gruss
Friedhelm

(11.12. 10:53 Tino) Code-Tags hinzugefügt.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 10.12.02 19:28 
Also mit dem Befehl, den Du verwendet hast (also das Selected) bekommst Du doch nur die Information, ob der Eintrag j selektiert oder nicht. Das mit dem überschreitet hört sich an, als würde j ein Item an einer zu hohen Position ansprechen.

Was Du brauchst ist SelCount. Das gibt Dir direkt aus, wieviel Einträge selektiert sind.

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 11.12.02 11:52 
Hallo Friedhelm,

außerdem würde ich Dir raten das Du Deinen Komponenten vernüftige Namen gibst. Namen wie listbox67 oder Label219 sind da nicht sehr gut!

Gruß
TINO
Friedhelm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 14.12.02 19:43 
Hallo Tino,

Listbox67 wäre dann z.B. "Projektstatus" o.s.ä.? Das meinst du doch?

Gruss Friedhelm
Friedhelm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 14.12.02 19:45 
Hallo Peter aus Düss.

ja, ich habs. Es klappt. Danke.

Gruss friedhelm
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: So 15.12.02 12:51 
Friedhelm hat folgendes geschrieben:
Listbox67 wäre dann z.B. "Projektstatus" o.s.ä.? Das meinst du doch?

Ja, genau das meine ich!

Gruß
TINO
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 15.12.02 15:28 
Eventuell noch die Präfix "lbl" davor setzten, damit man sieht, dass es ein Label ist: lblProjektstatus.