R
rgn
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.FormCreate(Sender: TObject);
begin
KeyPreview := True;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_DOWN: if ActiveControl is TDBEditEh then Perform(WM_NEXTDLGCTL, 0, 0);
VK_UP: if ActiveControl is TDBEditEh then Perform(WM_NEXTDLGCTL, 1, 0);
end;
end;
其它的控件都可以用方向键传递,上面这样指明TDBEditEh也不行
begin
KeyPreview := True;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_DOWN: if ActiveControl is TDBEditEh then Perform(WM_NEXTDLGCTL, 0, 0);
VK_UP: if ActiveControl is TDBEditEh then Perform(WM_NEXTDLGCTL, 1, 0);
end;
end;
其它的控件都可以用方向键传递,上面这样指明TDBEditEh也不行