Autor Beitrag
Cookie007
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Mi 06.12.06 20:10 
wie wählt man das erste item einer listbox aus (integerwert)

ausblenden Delphi-Quelltext
1:
x:= listbox1.items.???					

thx cookie 007


Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Mi 06.12.2006 um 20:26

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.12.06 20:15 
Hallo!

listBox1.ItemIndex ist der Index des aktuell ausgewählten Eintrags. Den Wert kann man setzen und lesen. Der erste Eintrag hat den Index 0.

Grüße
Christian

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

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Mi 06.12.06 20:24 
ja aber wie kann ich den denn jetzt setzen denn itemindex hat keine parameter!
ausblenden Delphi-Quelltext
1:
2:
// in meiner listbox sind 10 items ich will, dass der integerwert des ersten zu x wird!
 X := listbox1.???

danke aber schon mal für die rückmeldung
cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.12.06 20:27 
Wenn Du nicht weißt, wie man eine Eigenschaft setzt, solltest Du Dir mal ein paar Grundlagen ansehen. :?

ausblenden Delphi-Quelltext
1:
listBox1.ItemIndex := 0					

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

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Mi 06.12.06 20:36 
ausblenden Delphi-Quelltext
1:
2:
3:
listbox1.itemindex := 0;
  Y := listbox1.ItemIndex;
  edit1.Text := inttostr(y)

ich glaube wir verstehn uns miss,
ich will hier nicht 0 rausbekommen:
wenn der string des items 10 ist
will ich das y zu 10 wird
so krich ich hier null raus
danke cookie007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.12.06 20:40 
Achso, das meinst Du mit auswählen. Dann musst Du ItemIndex natürlich nix zuweisen.

Mit listBox1.Items[8] greifst Du z.B. auf das neunte Item zu (also das mit Index 8 ).

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

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Mi 06.12.06 20:42 
Ich dnke dir & einen schönen Abend
Cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)