PostMessage(self.Handle, WM_NEXTDLGCTL, 0, 1) working alternately


2004-02-01 06:13:00 PM
delphi55
Using code below to have key down do next control and key up previous.
PostMessage(self.Handle, WM_NEXTDLGCTL, 0, 0)
works perfect for next but
PostMessage(self.Handle, WM_NEXTDLGCTL, 0, 1)
works only by pressing up TWICE for previous.
Doing something wrong here, don't I?
Hans
//==============================================================================
procedure TFormDierEdit.HandleMessages(var Msg: TMsg; var Handled:
Boolean);
begin
if (Msg.message = WM_KEYDOWN) then begin
if (Msg.wParam = VK_RETURN) or (Msg.wParam = VK_DOWN) then
if not (DBEdit_DIEREN_BYZON.focused or BitBtn1.focused) then
PostMessage(self.Handle, WM_NEXTDLGCTL, 0, 0);
if (Msg.wParam = VK_UP) then begin
if not (DBEdit_DIEREN_BYZON.focused or BitBtn1.focused) then
begin
PostMessage(self.Handle, WM_NEXTDLGCTL, 0, 1);
end;
end;
if (Msg.wParam = VK_TAB) then begin
if DBEdit_DIEREN_GEB_DAT.focused then
MessageBox(0,'leeftijd','',0);
if DBEdit_DIEREN_RAS.focused then begin
ComboRassen.dropdown;
end;
end;
end;
end;