Autor Beitrag
Michi_Mueller
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Sa 02.11.02 12:02 
Hallöchen,
hab mal ne Frage:

Wie ich ne ListBox in Spalten unterteile ist ja kein Problem(mit der Columns-Eigenschaft), aber wie fülle ich diese Spalten nun??

Wär nett wenn ihr mir weiterhelfen könntet!

Ciao
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Sa 02.11.02 16:06 
Hallo,

die ListBox füllst du entweder mit der Methode AddItem
oder über die Eigenschaft Items.

genaues findest du auch mit Beispielen in der Hilfe.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Sa 02.11.02 17:33 
@Sven: Was ist das denn für eine Methode AddItem?

Gruß
TINO
Michi_Mueller Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Sa 02.11.02 17:41 
Sorry, aber über Items krieg ich die Spalten nicht gefüllt! AddItems gibs zwar auch aber das isses auch nich!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 02.11.02 17:54 
Hi!

Hier mal ein Zitat aus der Delphihilfe:
Delphihilfe hat folgendes geschrieben:
For Columns values greater than 0, multiple columns accommodate the items as they wrap beyond the bottom of the list box.


Folglich kannst Du einzelnen Spalten nicht so ansprechen, wie Du das vorhast. Ich nehme an, du würdest gerne etwas machen, wie "erste Zeile, zweite Spalte", aber das scheint nicht möglich zu sein.

MfG,
Peter

P.S.: Sollte ich Dein Problem falsch verstanden habe, dann entschuldige.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Michi_Mueller Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Sa 02.11.02 17:58 
Nene, du hast das schon richtig verstanden! Nur wie soll ich denn sonst machen? Ich mein irgednen Zweck muss es ja haben und folglich muss es auch möglich sein die Spalten zu füllen!?
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 02.11.02 18:04 
Hi!

1. Die Spalten in der ListBox füllen sich automatisch. Wenn die Items nicht mehr in eine Spalte passen, kommen sie in die nächste.

2. Sollte das nicht das sein, was du brauchst, dann beschreib doch mal, was Du machen willst. Vielleicht können wir Dir dann besser helfen!

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Sa 02.11.02 18:37 
Hallo

@Michi_Mueller

Wenn du Zeilen und Spalten ansprechen möchtest schau dir
vieleich mal das TStringGrid an.


@TINO

Tino hat folgendes geschrieben:
@Sven: Was ist das denn für eine Methode AddItem?

Gruß
TINO


Zitat aus der Hilfe, Delphi 6 Personal
Zitat:
VCL Reference
TCustomListBox.AddItem

TCustomListBoxTCustomListBox See also

Adds an item to the list box

procedure AddItem(Item: String; AObject: TObject);

Description

Call AddItem to add a new item to the end of the list.

Item is the text of the item to add.

AObject is the object associated with the new item.
Alfons-G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 307

Win XP Prof, Linux, Win 7
D5 Prof, D7 Architect, D2005 Architect, D2007 Architect
BeitragVerfasst: Sa 02.11.02 21:22 
:wave:
In der Komponentensammlung LMD-Tools (Freeware-Version z.B. bei Torry erhältlich) gibt es eine Listbox, deren Spalten sich über eine zusätzliche Eigenschaft Columns() einzeln ansprechen lassen. Zum Eintragen ganzer Zeilen gibt es einen Separator, den man im Objektinspektor festlegt, der die Einträge auf die einzelnen Spalten aufteilt.

Wenn z.B. der Separator "|" ist, denn landet vom String "Spalte 1|Spalte 2|Spalte 3" dementsprechend in der ersten Spalte (Columns(0)) "Spalte 1" usw.
Risiken und Nebenwirkungen konnte ich bei der LMDListBox nicht feststellen.

;)

_________________
Alfons Grünewald
Michi_Mueller Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Sa 02.11.02 22:27 
Danke sehr! Werds mal ausprobieren!

Ciao
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 03.11.02 12:54 
@Michi: Versuch es doch einfach mal mit der tListView. Die sollte doch eigentlich das machen was Du suchst, oder?

@Sven: Danke für die Info. In Delphi 5 ist diese Methode allerdings noch nicht vorhanden!

Gruß
TINO
Michi_Mueller Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: So 03.11.02 14:46 
@Tino: Hab ich schon, aber ich möcht keine Spaltenüberschriften haben! Und ohne die geht bei der ListView nich!
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: So 03.11.02 16:29 
Michi_Mueller hat folgendes geschrieben:
@Tino: Hab ich schon, aber ich möcht keine Spaltenüberschriften haben! Und ohne die geht bei der ListView nich!


Habe es hier gerade getestet,
ausblenden Quelltext
1:
ListView.ShowColumnHeaders := false;					

funktioniert.