Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid: How to keep cell focus in the same cell after pressing Enter

Status
Not open for further replies.

phil22046

Programmer
Joined
Sep 12, 2001
Messages
154
Location
US
In my VFP 9 application, one of the requirements is that cell focus remains in the same cell in the 3rd column of a 5 column grid after typing in a number and pressing enter.
Default Foxpro behavior move the focus to the cell to the right. Have can I disable this behavior?
 
one of the requirements is that cell focus remains in the same cell in the 3rd column of a 5 column grid after typing in a number and pressing enter.

This code ( untested ) in the KeyPress:

Code:
IF nKeyCode = 13 && Enter Key
  *** See if the user entered a number
  IF CHRTRAN( ALLTRIM( This.Value ), CHRTRAN( This.Value, [0123456789], [] ), [] ) == ALLTRIM( This.Value )
    NODEFAULT
  ENDIF
ENDIF

Marcia G. Akins
 
Well I have been experimenting with putting nodefault in the lostfocus event. I am working on the if statement needed to check the lastkey = 13.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top