![]() |
Control im dynamisch erstellten Form ansprechen
Moin moin,
wie spreche ich ein Control an, dass ich dynamisch erzeugt habe und in einem Frame (in diesem Fall ein Panel) anzeige.
Delphi-Quellcode:
In diesem Formular gibt es eine Query, die ich halt
Application.CreateForm(Tma_planung_detailform, ma_planung_detailform);
ma_planung_detailform.Parent := Panel1; ma_planung_detailform.ma_id := Ma_ID; ma_planung_detailform.JahresZahl := Jahr; ma_planung_detailform.BorderStyle := bsNone; ma_planung_detailform.Left := ((Counter+1)*ma_planung_detailform.Width); ma_planung_detailform.Name := 'ma_detail'+IntToStr(Counter); ma_planung_detailform.Show; ma_planung_detailform.Align := alLeft; gern jetzt aus meinem übergeordneten Formular ansprechen würde. Ich steh da momentan 'n wenig auf dem Schlauch. Moin |
Re: Control im dynamisch erstellten Form ansprechen
FindComponent kann dir da helfen.
Beispiel:
Delphi-Quellcode:
var
btn : TButton begin btn := Form1.FindComponent('Button1'); end; |
Re: Control im dynamisch erstellten Form ansprechen
Hilft mir jetzt nicht wirklich.
Ich weiß ja, dass meine DetailForm eine Query enthät, und ich weiß auch ihren Namen. Da ich mein "Unterformular" allerdings mehrfach erzeuge und in einem Panel "verframe", komme ich so nicht weiter. Moin |
Re: Control im dynamisch erstellten Form ansprechen
Dann speichere irgendwo einen Instanzzeiger auf diese Controls oder auf die Frames.
(z.B. in einer TObjectList) |
Re: Control im dynamisch erstellten Form ansprechen
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18: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 by Thomas Breitkreuz