Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi TAction -> FinComponent klappt nciht richtig ? (https://www.delphipraxis.net/109930-taction-fincomponent-klappt-nciht-richtig.html)

HolgerCW 10. Mär 2008 13:01


TAction -> FinComponent klappt nciht richtig ?
 
Hallo zusammen,

wieso findet er hier nichts:

Delphi-Quellcode:
var
MeineAction: TAction;

...

MeineAction := TAction(FindComponent('Action1'));
Was amche ich falsch ?

Gruss

Holger

mkinzler 10. Mär 2008 13:02

Re: TAction -> FinComponent klappt nciht richtig ?
 
Existiert die Komponente und ist die aktuelle Form ihr Owner?

HolgerCW 10. Mär 2008 13:18

Re: TAction -> FinComponent klappt nciht richtig ?
 
Das mit dem Owner war der Hinweis.

Hatte mit:

Delphi-Quellcode:
With DM.Actionlist do
begin

 ....


end;
gearbeitet.


So reicht es:

Delphi-Quellcode:
With DM do
begin

...

end;
Gruss

Holger

HolgerCW 10. Mär 2008 13:23

Re: TAction -> FinComponent klappt nciht richtig ?
 
Muss ich die Actionlist irgendwie refreshen, oder warum übernimmt er dann nciht das enabled = TRUE ?

Gruss

Holger

HolgerCW 11. Mär 2008 09:43

Re: TAction -> FinComponent klappt nciht richtig ?
 
Jetzt klappt es. Ich denke man muss wohl erst onExecute eine procedure zuweisen, bevor es klappt.

Gruss

Holger

Sharky 11. Mär 2008 10:57

Re: TAction -> FinComponent klappt nciht richtig ?
 
Zitat:

Zitat von HolgerCW
Jetzt klappt es. Ich denke man muss wohl erst onExecute eine procedure zuweisen, bevor es klappt.
...

Hai Holger,

genau so ist es. Ohne ein OnExecute sind die Controls welche mit einer TAction verbunden sind immer disabled.


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:56 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