![]() |
Combobox Werte sollen Action1.execute, Action2.execute ausführen
Hallo,
hat jemand eine Idee wie ich eine Combobox so konfiguriere, das ich wenn im Combobox Wert1 anklicke die funktion Action1.execute ausgeführt wird Wert2 anklicke die funktion Action2.execute ausgeführt wird für jeden Hinweis oder Tipp bin ich sehr Dankbar. |
AW: Combobox Werte sollen Action1.execute, Action2.execute ausführen
Hey,
Eine Idee wäre den Name der Anwendung (z.b. Calculator.exe oder NotePad.exe) von der Combobox an die ![]() |
AW: Combobox Werte sollen Action1.execute, Action2.execute ausführen
Im OnClick bekommst du doch den ItemIndex mit:
Code:
Mit if oder case.
wenn Item1 angeklickt
mache das wenn Item2 angeklickt mache das |
AW: Combobox Werte sollen Action1.execute, Action2.execute ausführen
Wenn du dir
![]()
Delphi-Quellcode:
Welchen Text man beim Füllen der Items verwendet ist natürlich völlig egal, Hauptsache, man packt eine Action (oder eine Ableitung derselbigen) als Object dazu.
procedure TForm1.FormCreate( Sender : TObject );
begin // Items der ComboBox vorbelegen ComboBox1.Items.AddObject( Action1.Caption, Action1 ); ComboBox1.Items.AddObject( Action2.Caption, Action2 ); end; procedure TForm1.ComboBox1Change( Sender : TObject ); begin if Assigned( ComboBox1.Items.Objects[ ComboBox1.ItemIndex ] ) and ( ComboBox1.Items.Objects[ ComboBox1.ItemIndex ] is TAction ) then TAction( ComboBox1.Items.Objects[ ComboBox1.ItemIndex ] ).Execute; end; |
AW: Combobox Werte sollen Action1.execute, Action2.execute ausführen
Hey super Danke für die vielen Antworten, heute komme ich leider nicht mehr dazu diese mal zu testen.. aber morgen nachmittag werd ich mich mal dran setzen.
Danke euch allen einen guten Rutsch ins neue Jahr. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:05 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