Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi ComboBox per Button Item auswählen (https://www.delphipraxis.net/10252-combobox-per-button-item-auswaehlen.html)

billi 14. Okt 2003 18:32


ComboBox per Button Item auswählen
 
Hallo,
ich bräuchte eine onklick Prozedure für einen Butten der bei einer Combobox einen neuen Eintrag über die Itemnummer auswählt.
In der Hilfe hab ich nur das gefunden:
Delphi-Quellcode:
RichEdit1.Font.Name := ComboBox1.Items[ComboBox1.ItemIndex];
Damit weise ich aber einem anderen Element das selektierte Item der Combobox zu.
Delphi-Quellcode:
ComboBox1.Items.text := ComboBox1.Items[ComboBox1.ItemIndex];
Das geht ja auch nicht! Wie löse ich denn jetzt mein Problem.

gruß
billi

PS: und nochwas, wie bekomme ich die Anzahl aller Items in der Combobox liste?

SirThornberry 14. Okt 2003 18:35

Re: ComboBox per Button Item auswählen
 
also ich hab die frage nicht wirklich verstanden gehe aber mal davon aus das du den Text der Comboboxauswahl ändern willst?!

Combobox1.items.item[combobox1.itemindex] := 'neuer Text';

axelf98 14. Okt 2003 18:39

Re: ComboBox per Button Item auswählen
 
Die Anzahl: combobox1.Items.Count;

Alexander 14. Okt 2003 18:41

Re: ComboBox per Button Item auswählen
 
Kuck dir mal ItemIndex an, damit kannst du den Index, also welches ITem markiert sein soll, festlegen...

billi 14. Okt 2003 19:45

Re: ComboBox per Button Item auswählen
 
vielen Dank, das war's!!!
gruß
billi7


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:06 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz