O
oer_2001
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm20.Action1Execute(Sender: TObject);
begin
showmessage('action1');
end;
procedure TForm20.FormCreate(Sender: TObject);
var
act: TActionList;
action: TAction;
begin
act := TActionList.Create(self);
act.Name := 'act';
action := TAction.Create(act);
action.ShortCut := TextToShortCut('Ctrl+M');
action.OnExecute := Action1Execute;
ToolButton1.Action := action;
end;
运行后,我按Ctrl+M, 为什么不能执行相应的操作??而点ToolButton1按钮可以执行。
begin
showmessage('action1');
end;
procedure TForm20.FormCreate(Sender: TObject);
var
act: TActionList;
action: TAction;
begin
act := TActionList.Create(self);
act.Name := 'act';
action := TAction.Create(act);
action.ShortCut := TextToShortCut('Ctrl+M');
action.OnExecute := Action1Execute;
ToolButton1.Action := action;
end;
运行后,我按Ctrl+M, 为什么不能执行相应的操作??而点ToolButton1按钮可以执行。