![]() |
String aus Ini soll ComboBox auf gleichen Item einstellen!
Hallo!
Ich will mit einem String eine ComboBox ansprechen. Der String ist in der ComboBox identisch enthalten und diesen möchte ich jetzt anzeigen. Viele Grüße... |
Re: String aus Ini soll ComboBox auf gleichen Item einstelle
Moin
Geht
Delphi-Quellcode:
nicht?
ComboBox1.Text := 'blubb';
|
Re: String aus Ini soll ComboBox auf gleichen Item einstelle
Hi!
Nein, das geht nicht. Die ComboBox ist auf csDropDownList eingestellt. Das soll auch wenn möglich so bleiben. |
Re: String aus Ini soll ComboBox auf gleichen Item einstelle
Nicht sehr performant, aber wenn die Liste nicht zu lange ist, vernachlässigbar:
Delphi-Quellcode:
Nachtrag: :)
for i := 0 to ComboBox1.Items.Count - 1 do
begin if ComboBox1.Items[i] = 'blubb' then begin ComboBox1.ItemIndex := i; break; end; end;
Delphi-Quellcode:
ComboBox1.ItemIndex := ComboBox1.Items.IndexOf('blubb');
|
Re: String aus Ini soll ComboBox auf gleichen Item einstelle
:wall: Da hätt ich auch selber drauf kommen können!
Funktioniert! Vielen Dank... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:31 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