Autor Beitrag
Andre :-)
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Sa 15.02.03 21:47 
Hallo,

ich habe in meiner Combobox n Einträge. Wie kann ich dort den letzten Eintrag in der Combobox anzeigen lassen?

Irgendwie mit scroll?

Danke

Moderiert von user profile iconTino: Absätze entfernt.

_________________
Security is just a feeling, but never reality
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 15.02.03 22:01 
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Combobox1.Text := Combobox1.Items.Strings[Combobox1.Items.Count-1];
end;
Andre :-) Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Sa 15.02.03 22:14 
hab ich Dir schon gesagt dass ich Dich liebe? ....

_________________
Security is just a feeling, but never reality
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Sa 15.02.03 22:49 
Geht das nicht einfacher mit:
ausblenden Quelltext
1:
ComboBox1.ItemIndex:=ComboBox1.Items.Count-1					


Ich find das sieht schöner aus und es wählt auch den letzten Eintrag aus. Weil mit Deinem änderst Du doch nur den Text von Item 0?

Irre ich mich?

Gruß
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 15.02.03 23:01 
Geht beides.
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: So 16.02.03 09:20 
Andre :-) hat folgendes geschrieben:
hab ich Dir schon gesagt dass ich Dich liebe? ....
:lol:


Schreib halt gleich im Object-Inspektor bei der ComboBox unter Text den Text wo du haben willst!

PS: @Luckie: Du hast hier heimliche Verehrer!