Page 1 of 3
ENTER key
Posted: Sat Mar 18, 2017 9:05 am
by serge_girard
Hello,
Is there a simple way to force a form to focus on the next textbox/combo/.. control when one hits the ENTER like(TAB) key?
Now I use this:
Code: Select all
@ 400,430 TEXTBOX t1 ;
WIDTH 120 ;
HEIGHT 25 ;
FONT "Arial" SIZE 8 ;
VALUE 'some value';
NUMERIC ;
INPUTMASK '999999.99' ;
ON GOTFOCUS Form_1.t1.BackColor := WHITE ;
ON LOSTFOCUS {Form_1.t1.BackColor := SILVER } ;
ON ENTER {Form_1.t2.SetFocus } // next textbox
What I want is to to the force to behave on every ENTER to move to the next control (just like in old Clipper..)
The code above works but with many controls it becomes rather confusing.
Thx, Serge(like
ENTER key
Posted: Sat Mar 18, 2017 10:40 am
by Pablo César
Hi Serge,
Give a look at
viewtopic.php?p=33041#p33041
If is with this that you can solve your case.
In this example uses
SetConfOFF() but you can disable it.
SET NAVIGATION EXTENDED is very used for navigating as you require and when you want to force, there are:
_SetNextFocus function which is using
InsertTab() for navigation.
Re: ENTER key
Posted: Sat Mar 18, 2017 11:03 am
by Rathinagiri
I use 'SET NAVIGATION EXTENDED'. It works except for tree, listbox and Grid.
Re: ENTER key
Posted: Sat Mar 18, 2017 12:10 pm
by serge_girard
Thx Pablo, I will try !
One thing: when SET NAVIGATION EXTENDED is set in main will it be applicable in all forms or do I have to set it on/off in every form?
Serge
ENTER key
Posted: Sat Mar 18, 2017 12:18 pm
by Pablo César
It will work in all forms upto the time you change back for:
SET NAVIGATION STANDARD
Because:
#xtranslate SET NAVIGATION STANDARD ;
=> ;
_HMG_SYSDATA \[ 255 \] := .F.
There is also how to change behaviour for navigation at GRID with:
SET CELLNAVIGATIONMODE EXCEL
This last change for moviment to DOWN + ENTER in Grids.
This must be documented at our Grid.htm (DOC) because is not (I guess).
Re: ENTER key
Posted: Sat Mar 18, 2017 1:31 pm
by serge_girard
So much to learn... !
Thanks very much Pablo !
Serge
ENTER key
Posted: Sat Mar 18, 2017 5:50 pm
by Pablo César
serge_girard wrote: ↑Sat Mar 18, 2017 1:31 pm
So much to learn... !
You are welcome friend.
Do not worry, always all of us we have !
Pablo César wrote: ↑Sat Mar 18, 2017 12:18 pm
There is also how to change behaviour for navigation at GRID with: SET CELLNAVIGATIONMODE EXCEL
This last change for moviment to DOWN + ENTER in Grids.
This must be documented at our Grid.htm (DOC) because is not (I guess).
Please Dr, Claudio, would please be so kind to replace it ?
- Grid.rar
- ..\DOC\data
- (13.58 KiB) Downloaded 160 times
Please also note in this attached file I removed:

- Screen131.png (10.41 KiB) Viewed 3535 times
And added:

- Screen132.png (21.76 KiB) Viewed 3535 times
Re: ENTER key
Posted: Sat Mar 18, 2017 5:58 pm
by serge_girard
And to REMEMBER ....!
Anyway now it works like I want. Thanks again!
Serge
ENTER key
Posted: Sun Mar 19, 2017 12:19 am
by Pablo César
Just for information and guidance:
Rathinagiri wrote: ↑Sat Mar 18, 2017 11:03 am
I use 'SET NAVIGATION EXTENDED'. It works except for tree, listbox and Grid.
I guess for some more neither: Buttons, EditBoxes, HyperLinks, Images, Labels, RadioGroups, Sliders, Tabs and Spinners. Not works at all.
For the rest, I tested it works basically in TextBoxes, ComboBoxes, DatePickers and CheckBoxes. Only.
serge_girard wrote: ↑Sat Mar 18, 2017 5:58 pm
Anyway now it works like I want. Thanks again!
Nice one, Serge.

Re: ENTER key
Posted: Mon Mar 20, 2017 2:55 pm
by quartz565
Thank you Pablo !!