K
kwmxw
Unregistered / Unconfirmed
GUEST, unregistred user!
我想用mainmenu组件中的两个N1,N2来调用actionlist的组件action1
程序如下:
sqltxt为全局变量
procedure TFormmain.N1lick(Sender: TObject);
begin
sqltxt:='张三';
n1.action:=action1;
n1.action.execute;
end;
procedure TFormmain.N2lick(Sender: TObject);
begin
sqltxt:='李四'
n2.action:=saledata.action1;
n2.action.Execute;
end;
procedure Action1Execute(Sender: TObject);
begin
Memo1.Text:=sqltxt;
end;
运行结果如下:
点击N1:
memo1中显示“张三”;
点击N2:
memo1中显示“李四”;
[red]但是再点击N1:
memo1中显示“李四”[/red]
这种情况怎么修改?
程序如下:
sqltxt为全局变量
procedure TFormmain.N1lick(Sender: TObject);
begin
sqltxt:='张三';
n1.action:=action1;
n1.action.execute;
end;
procedure TFormmain.N2lick(Sender: TObject);
begin
sqltxt:='李四'
n2.action:=saledata.action1;
n2.action.Execute;
end;
procedure Action1Execute(Sender: TObject);
begin
Memo1.Text:=sqltxt;
end;
运行结果如下:
点击N1:
memo1中显示“张三”;
点击N2:
memo1中显示“李四”;
[red]但是再点击N1:
memo1中显示“李四”[/red]
这种情况怎么修改?