form= TForm
……
ActionList: TActionList; //右键添加一个Action 名为:action1
MenuItem: TMenuItem;
proc
var
TempItem: TMenuItem;
begin
TempItem:= NewItem('Caption',TexttoShortcut(''),(boolean)checked,(boolean)enabled),Action1.OnExcute,0,'Name');
MenuItem.Items.Add(TempItem);
end;procedure Action1.Onexcute(sender:……);
begin
if (Sender as TMenuItem).Name= 'KillUSA' then
begin
Plane.Fly;
Plane.Down;
Skyscraper.Crush;
end;
end;
……
ActionList: TActionList; //右键添加一个Action 名为:action1
MenuItem: TMenuItem;
proc
var
TempItem: TMenuItem;
begin
TempItem:= NewItem('Caption',TexttoShortcut(''),(boolean)checked,(boolean)enabled),Action1.OnExcute,0,'Name');
MenuItem.Items.Add(TempItem);
end;procedure Action1.Onexcute(sender:……);
begin
if (Sender as TMenuItem).Name= 'KillUSA' then
begin
Plane.Fly;
Plane.Down;
Skyscraper.Crush;
end;
end;
form= TForm
……
ActionList: TActionList; //右键添加一个Action 名为:action1
MenuItem: TMenuItem;
proc
var
TempItem: TMenuItem;
begin
TempItem:= NewItem('Caption',TexttoShortcut(''),(boolean)checked,(boolean)enabled),Action1.OnExcute,0,'Name');
MenuItem.Items.Add(TempItem);
end;procedure Action1.Onexcute(sender:……);
begin
if (Sender as TMenuItem).Name= 'GotoUSA' then
begin
Plane.Fly;
Plane.Down;
USA.Welcome;
end;
end; That's O.K.?