![]() |
Combobox -> Property Text -> Property Style:=csDropDow
Hallo,
Wie kann ich einer Combobox einen Text zuweisen, wenn Combobox.Style:=csDropDownList ist.
Delphi-Quellcode:
Wird ohne Fehler ausgeführt, aber der Text der Combobox1 bleibt leer.
Combobox1.Text := 'Test';
Wenn ich jedoch ein Item mit der Maus auswähle erscheint das ausgewählte Item in Combobox1.Text. Hintergrund: Ich fülle eine Combobox mit mehreren Items. Beim ersten Start soll standardmäßig das erste Item ausgewählt sein. Der Benutzer soll keinen eigenen Text in der Combobox eingeben können, deshalb Style = csDropDownList. Mein bisheriger Code:
Delphi-Quellcode:
Wie kann ich dieses Problem lösen?
if cb_DB.Items.Count > 0 then begin
cb_DB.Text := cb_DB.Items[0]; //einige Datenbank aufrufe auf Basis der Comboboxauswahl (cb_DB) end; MfG Hitzi |
Re: Combobox -> Property Text -> Property Style:=csDro
Kuck dir mal ITemIndex an.
|
Re: Combobox -> Property Text -> Property Style:=csDro
Vielen Dank. Funktioniert.
MfG Hitzi |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:06 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz