Autor Beitrag
Conchiglia
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Fr 12.11.04 10:57 
Als erstes muss ich zu meiner Verteidigung anfügen, dass ich keine Ahnung von Delphi habe. Die Frage die ich hier einstellen werde, stelle ich für jemand anderes, der zur Zeit kein Internet hat, aber trotzdem programmieren möchte. Danke schon mal im voraus.

Also....
Wie kann man in Delphi auf bestimmte Sachen einer Combobox zugreifen?
Folgender Ansatz wurde angedacht: label1.caption:=combobox1.itemindex(0)
Das scheint aber wohl nicht zu funktionieren...
Hat jemand eine Ahnung?

Danke


Moderiert von user profile iconTino: Topic aus Datenbanken verschoben am Mi 08.12.2004 um 23:51
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Fr 12.11.04 11:00 
Ja:
ausblenden Delphi-Quelltext
1:
2:
if ComboBox1.ItemIndex > -1 then       // prüfen ob etwas ausgewählt wurde
  Label1.Caption := ComboBox1.Items[ComboBox1.ItemIndex];   // Auswahl in die Caption des Labels schreiben


über comboBox.Items[i] greift man auf die einzelnen Items zu. Gültig für i sind 0 bis Anzahl der Items-1.

raziel

_________________
JSXGraph
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Fr 12.11.04 11:40 
raziel hat folgendes geschrieben:
über comboBox.Items[i] greift man auf die einzelnen Items zu. Gültig für i sind 0 bis Anzahl der Items-1.


DAS war die Antwort.

Der Code war es weniger ... :wink:

Zu erwähnen wäre darüberhinaus auch vielleicht noch ComboBox.Text, welches das Eingabefeld der ComboBox repräsentiert.