标签:io os ar sp on cti bs as tt
procedure TFrameEntry.aplctnvnts1Message(var Msg: tagMSG; var Handled: Boolean); var aWinControl: TWinControl; begin if (Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP) then begin if Assigned(FCurrentEditBox) and (Msg.wParam = VK_F1) and (Screen.ActiveControl <> FCurrentEditBox) then begin if FCurrentEditBox.CanFocus then FCurrentEditBox.SetFocus; Handled := True; Exit; end; end; if not (Screen.ActiveControl is TEdit) then Exit; if (Msg.message = WM_RBUTTONDOWN) or (Msg.message = WM_PASTE) then begin Handled := True; end else if (Msg.message = WM_SYSKEYDOWN) or (Msg.message = WM_SYSKEYUP)then begin if Msg.wParam in [VK_TAB, VK_RWIN, VK_APPS, VK_SLEEP, VK_F10] then Handled := True; end else if (Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP) then begin if (ssCtrl in KeyDataToShiftState(Msg.lParam)) then begin if (Msg.wParam in [Ord(‘C‘), Ord(‘V‘)]) or (Msg.wParam in [VK_TAB, VK_RWIN, VK_APPS, VK_SLEEP]) then begin Handled := True; end else end else if Msg.message = WM_KEYDOWN then begin if Msg.wParam = VK_RETURN then begin aWinControl := FindNextControl(Screen.ActiveControl, true, false, false); if (aWinControl is TEdit) and aWinControl.CanFocus then begin aWinControl.SetFocus; if FIsFirstEditBox then FIsFirstEditBox := False; end else begin FIsLastEditBox := True; lbl3.Caption := ‘Last‘; end; Handled := True; end else if Msg.wParam = VK_F9 then begin aWinControl := FindNextControl(Screen.ActiveControl, False, false, false); if (aWinControl is TEdit) and aWinControl.CanFocus then begin aWinControl.SetFocus; if FIsLastEditBox then FIsLastEditBox := False; end else begin FIsFirstEditBox := True; lbl3.Caption := ‘First‘; end; Handled := True; end; end; end; end;
标签:io os ar sp on cti bs as tt
原文地址:http://my.oschina.net/u/582827/blog/339168