在Windows 7下使用DelphiXE編譯的下面一段delphi代碼在Windows XP系統上以不同方式運行。 在表單中,我們有一個處理用戶對VK_Fxx鍵的響應的過程。在WinXP和Win7下delphi代碼執行的區別。爲什麼?
procedure TfrmGA010.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
inherited;
KillKey := False;
if bvMF1Panel.Enabled then
begin
case Key of
VK_F3 : begin
...........
key := 0;
KillKey := True;
exit;
end;
VK_F4 : begin
............
key := 0;
KillKey := True;
exit;
end;
VK_F5 : begin
...........
key := 0;
KillKey := True;
exit;
end;
VK_F7 : begin
.......
key := 0;
KillKey := True;
exit;
end;
VK_F8 : begin
........
key := 0;
KillKey := True;
exit;
end;
VK_F11 : begin
if YesNoMsg('Delete?') then
begin
..........
**F5.Click;**
end;
exit;
end;
end;
end;
行代碼F5.Click是在Windows XP而不是Windows 7的其中跳過,並計劃繼續下一步下執行。請幫忙嗎?
@巴克斯喬治,你可以請給出完整的代碼VK_F11塊。 –
@Gamecat,VK_F11塊中缺少的代碼行只是調用一個firebird存儲過程來刪除幾條記錄。 –
如果你註釋掉這些行,它仍然不起作用?但YesNoMsg行被執行?缺少的行可能有一個例外... – Birger