procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
const
(* Классный участок кода от Graphical Gnome *)
KeyBtn: array[TNavigateBtn] of record
Key: Word;
Btn: TNavigateBtn;
end = (
(Key: VK_F1; Btn: nbFirst),
(Key: VK_F2; Btn: nbPrior),
(Key: VK_F3; Btn: nbNext),
(Key: VK_F4; Btn: nbLast),
(Key: VK_F5; Btn: nbInsert),
(Key: VK_F6; Btn: nbDelete),
(Key: VK_F7; Btn: nbEdit),
(Key: VK_F8; Btn: nbPost),
(Key: VK_F9; Btn: nbCancel),
(Key: VK_F10; Btn: nbRefresh)
);
var
i: TNavigateBtn;
begin
for i := nbFirst to nbRefresh do
if KeyBtn[i].Key = Key then
begin
DBNavigator1.BtnClick(KeyBtn[i].Btn);
Exit;
end;
end;
|