你可以这样实现:procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then //判断是否是回车键 begin key:=#0; //取消蜂鸣 BitBtn4Click(sender); //执行BitBtn4Click过程 end; end;procedure TForm1.BitBtn4Click(Sender: TObject); begin //Do something you want end;------------------------------------------------------------------- 风过西窗客渡舟船无觅处 年年一川新草遥看却似旧
来晚了,总结一下: 在Edit的KeyPress事件中写: If Key=#13 then BitBtn4.Click; 或者 Bitbtn4Click(Sender);
来晚了,总结一下: 在Edit的KeyPress事件中写: If Key=#13 then BitBtn4.Click; 或者 Bitbtn4Click(Sender);
来晚了,总结一下: 在Edit的KeyPress事件中写: If Key=#13 then BitBtn4.Click; 或者 Bitbtn4Click(Sender);
begin
if key=#13 then //判断是否是回车键
begin
key:=#0; //取消蜂鸣
BitBtn4Click(sender); //执行BitBtn4Click过程
end;
end;procedure TForm1.BitBtn4Click(Sender: TObject);
begin
//Do something you want
end;-------------------------------------------------------------------
风过西窗客渡舟船无觅处
年年一川新草遥看却似旧
在Edit的KeyPress事件中写:
If Key=#13 then
BitBtn4.Click;
或者
Bitbtn4Click(Sender);
在Edit的KeyPress事件中写:
If Key=#13 then
BitBtn4.Click;
或者
Bitbtn4Click(Sender);
在Edit的KeyPress事件中写:
If Key=#13 then
BitBtn4.Click;
或者
Bitbtn4Click(Sender);