var
i: integer;
begin
with ActionList1do
begin
for i := 0 to ActionCount - 1do
ListBox1.Items.Add(TAction(Form1.FindComponent(Actions.name)).Caption) ;
end;
end;
to RedBeret,加上Form1.FindComponent干嘛?而且是ListView,你的是ListBox
例子如下:
var i:integer;
begin
for i:=0 to ActionList1.ActionCount-1do
ListView1.AddItem(TAction(ActionList1.Actions).Caption,nil);