Subject Re: [IBO] Trapping the TAB-key
Author Freddy Holst Christensen
Hello Again NICO

Thanks for the tip, it gave me a starting point..
But there still is a problem , but because KeyPreview works with
keyboard events, and the TAB-key don't generate a
Keyboard event. According to the help-file.

And the database field have an EditMask, and I narrowed it down the the
error aoccuring at dataset-level, when the field
isn't completed. And after trying different dataset event I still wasn't
able to catch the error.

But know I have found a way, with code in a KeyUp-event that work
around the problem.

Regards
Freddy




Nico Callewaert wrote:

> Good morning Freddy,
>
> First of all, you have to set the KeyPreview property of the form to
> True. Then you can write a KeyUp event for the form like this :
>
>
> procedure TPurchase_Frm.FormKeyUp(Sender: TObject; var Key: Word;
> Shift: TShiftState);
> begin
> if Key = VK_TAB then
> Key := 0;
> end;
>
> HTH,
> Nico Callewaert
> ncw@...
> nico.callewaert@...
>
>
>
>
>
>