Page 1 of 1

How can I use Return key to move next get

Posted: Wed Jun 20, 2007 2:04 pm
by Arindam
Hi Everybody,

While I am pressing ENTER on Combobox, Cursor do not move in next get field. If I press Tab bottom, then only Cursor move to next field.

How Can I use Enter, to move Cursor to next field. My code is as follows.

Code: Select all

     REDEFINE COMBOBOX oCbx VAR cCuTy ITEMS  { "URBAN ", "RURAL ", "DEEPAM", "COMMON" }               ; 
      ID 2 OF oDlg1                                                                                   ; 
      ON CHANGE MsgBeep()                                                                             ; 
      Valid If(cCuTy = oCbx:aItems[1],  (oArea:AreaType := "U", .T.), If(cCuTy = oCbx:aItems[2],      ; 
                                        (oArea:AreaType := "R", .T.), If(cCuTy = oCbx:aItems[3],      ; 
                                        (oArea:AreaType := "D", .T.), (oArea:AreaType := "C", .T.)))) ; 
      Picture "@!" Color RGB(0, 0, 0), RGB(255, 255, 255) 

With regads,

Arindam

Posted: Wed Jun 20, 2007 6:54 pm
by James Bott
Arindam,

Using the Enter key is DOS behavior not Windows behavior so I don't recommend using it. Under Windows the Enter key should trigger the OK button on the dialog. The Tab key is what users expect to use to move from field to field. This way the user can press the Enter key anytime to close the dialog without using the mouse.

If you still want to use it, then check the "Want Return" checkbox for the control using Workshop.

James

Posted: Wed Jun 20, 2007 10:06 pm
by Armando
Arindam:

Perhaps the problem is in the VALID code, pls remove that code and
test it again.

BTW, you do not need that code, if your field is one character length then only the capital letter will saved.

Regards