procedure TZydj_DjForm.FormKeyDown(Sender: TObject
var Key: Word;
Shift: TShiftState);
procedure Click(aDBNavButton: TwwNavButton);
begin
with aDBNavButton do if Enabled then Click;
Key:=0;
end;
begin
if Zy_DataModule.DataSource_Zydjb.DataSet.State in [dsInsert,dsEdit] then
case Key of
VK_ESCAPE (*#27*): Click(wwDBNavigator1Post);
$43 (*C*): if Shift = [ssCtrl] then Click(wwDBNavigator1Cancel);
end
else begin
case Key of
VK_PRIOR (*#33*): Click(wwDBNavigator1PriorPage);
VK_NEXT (*#34*): Click(wwDBNavigator1NextPage);
VK_INSERT(*#45*): Click(wwDBNavigator1Insert);
VK_DELETE(*#46*): Click(wwDBNavigator1Delete);
VK_HOME (*#36*): Click(wwDBNavigator1First);
VK_UP (*#38*): Click(wwDBNavigator1Prior);
VK_DOWN (*#40*): Click(wwDBNavigator1Next);
VK_LEFT (*#37*): Click(wwDBNavigator1Prior);
VK_RIGHT (*#39*): Click(wwDBNavigator1Next);
VK_END (*#35*): Click(wwDBNavigator1Last);
end;
if Shift = [ssCtrl] then
case Key of
$51 (*Q*): Click(wwDBNavigator1Button4)
//查询
$58 (*X*): Click(wwDBNavigator1Button1)
//退出
end;
end;
end;