可以使用actionList,然后在根据组件名称来指定<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls, ActnList;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> ActionList1: TActionList;<br> aaa: TAction;<br> procedure Button1Click(Sender: TObject);<br> procedure aaaExecute(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> button1.Action := FindComponent('aaa') as TbasicAction ;<br>end;<br><br>procedure TForm1.aaaExecute(Sender: TObject);<br>begin<br> showmessage('aaa is Excute!');<br>end;<br><br>end.