Autor Beitrag
rn22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Mo 04.09.06 21:13 
Hallo!

Ich habe fortgesetzt Probleme damit, die Markierung in meiner Listbox zu verändern.

Abfragen geht. Aber wenn ich im Selected-Array was ändern will,


ListBox1.Selected[2]:=false;


kommt ein Fehler (obere Grenze des Arrays verletzt) - obwohl einiges mehr als 3 Items in der ListBox sind.


Wer kann helfen?

Vielen Dank
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mo 04.09.06 21:15 
warum denn selected? ich würde es so machen:
listbox1.ItemIndex := -1; ;)

edit: selected funktioniert bei mir einwandfrei :roll:
rn22 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Mo 04.09.06 22:55 
Ja, mit ItemIndex gehts

Problem gelöst
Danke!
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 04.09.06 23:03 
Hallo,
wenn ListBox1.Multiselect True ist, dann bekommst Du damit:
ausblenden Delphi-Quelltext
1:
ListBox1.Selected[2]:=false;					
keinen Grenz-Verletzungsfehler mehr.

Mit der Zuweisung Selected[x]:=false kann man aus einer Mehrfachmarkierung einzelne Items gezielt deselectieren.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )