Hope this helps, our control is a dbGrid descendant but this would probably
work.

In the key on key down event compare the selectedIndex to the # of fields
    if (csGrid.SelectedIndex = csGrid.Columns.Count -1)

if you are on the last field then move to the next control, you could hard
code it
    nextcontrol.setfocus;

or use the tab order
    SelectNext(csGrid.Handle, True, True);




Rob

Software engineer
Wild Software Ltd
New Zealand

Ph 03 377-0495
Fax 03 377-0496
----- Original Message -----
From: "Corey Murtagh" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 3:08 PM
Subject: [DUG]: How to stop TDBCtrlGrid wrapping


> I want to use a TDBCtrlGrid for a form I'm designing, but the wrapping
> behavior is making things awkward.  I really need for Tab to exit the
> control once it reaches the end of the last record, but instead it wraps
> around to the first control in the last record's panel.  Same for
> Shift-Tab at the first control of the first record.
>
> I know I could fix this by creating a descendant of TDBCtrlGrid, but
> that's really overkill for this situation.
>
> Environment is BCB4, so any solution that works for the Delphi4 should
> be applicable here too.  Any help appreciated.
>
> --
> Corey Murtagh
> The Electric Monk
> "Quidquid latine dictum sit, altum viditur!"
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to