One way would be to set the tag property on each control in the normal entry
order then use and on exit like:

   if TEdit(Sender).Tag < ActiveControl.Tag then
      Label1.Caption := 'Forward'
   else
       Label1.Caption := 'Back';

To know where to process the validation code or not.

-----Original Message-----
From: Mark Howard <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Monday, 15 February 1999 09:16
Subject: [DUG]: Control of Focus


Hi
Newbie question.

I have a form with several edit boxes.

In order to make it efficient for data entry I have some code attached
to the OnExit event of some of the boxes which decides which is the next
box that should receive focus, when Tab is pressed.

This works fine for a normal entry sequence, but if something goes wrong
and the user needs to use the mouse to reselect an earlier box, or
wishes to click Save before cycling through the rest of the fields then
the OnExit event will override the mouse click, and merely set focus to
the edit box specified in the code.

How can I achieve this automatic moving to a specific box on pressing
Tab but allow a mouse click on a different control to have precedence?

Thanks

Mark

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to