>According to the help file, KeyPress won't occur for any combination of keys with the ALT key, so let's use CTRL+HOME instead.
>
>In the KeyPress method of the textbox of
every column in your grid, put the following code:
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>if nkeycode=29 and nshiftaltctrl=2
> this.parent.parent.column1.text1.setfocus()
> nodefault
>endif
>
>
>But personally I hate duplication of code, so I'd build a grid class, where every textbox has KeyPress code that simply calls a common grid method (called CommonKeyPress or some such) and have that do the setfocus and other behaviors if desired. That way you only have to change the code in one place if you want to tweak it.
Brad,
Ctrl+Home standard behaviour is to move to first row.
Can you recommend some other key ?
Why not to use form keypreview property? This eliminates the need to
add custom class to grid.
Andrus