Editbox and Tab key
Moderator: Rathinagiri
Editbox and Tab key
Hi everyone,
Is it possible to use the tab key in an Editbox control ?
When my user presses the tab key it changes the focus to the next control on the form ...
I'd like the user to be able to set up columns of data within the edit box, which he can only do by using the spacebar to format the text.
Is it possible to use the tab key in an Editbox control ?
When my user presses the tab key it changes the focus to the next control on the form ...
I'd like the user to be able to set up columns of data within the edit box, which he can only do by using the spacebar to format the text.
-
Carlos Britos
- Posts: 245
- Joined: Sat Aug 02, 2008 5:03 pm
Re: Editbox and Tab key
HIspelman wrote:Hi everyone,
Is it possible to use the tab key in an Editbox control ?
When my user presses the tab key it changes the focus to the next control on the form ...
I'd like the user to be able to set up columns of data within the edit box, which he can only do by using the spacebar to format the text.
Try with oEditBox TABSTOP = .F.
Carlos
Regards/Saludos, Carlos (bcd12a)
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Editbox and Tab key
No. Tabstop will pass on the editbox and you can't enter into the editbox in natural tab order.
For your problem, you can capture the tab key (using 'on key tab') and verify whether editbox is in focus. If it is, you can manually add the required spaces in the caret position. If the edit box is not is focus you can again simulate the tab key.
For your problem, you can capture the tab key (using 'on key tab') and verify whether editbox is in focus. If it is, you can manually add the required spaces in the caret position. If the edit box is not is focus you can again simulate the tab key.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Editbox and Tab key
Hi Rathi,
Thanks very much for the reply - that should do the trick !
Kind Regards,
Steve
Thanks very much for the reply - that should do the trick !
Kind Regards,
Steve
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Editbox and Tab key
Hi Steve
When you complete, could you share your code with us ?
Regards
--
Esgici
When you complete, could you share your code with us ?
Regards
--
Esgici
Viva INTERNATIONAL HMG 
Re: Editbox and Tab key
Prototype:
Credits: Hathinagiri
Code: Select all
DEFINE WINDOW F_SAMPLE...
...
ON KEY TAB ACTION F_RM_On_Key_Tab()
...
END WINDOW
*-------------------------------------*
*F_RM_On_Key_Tab()
*-------------------------------------*
Function F_RM_On_Key_Tab()
local i := 0
* Form/Window Name
local cFrmName := ThisWindow.Name()
* active control: name
local cCtrlName := ThisWindow.FocusedControl()
* Check if sender is a "Editbox"
IF GetControlType( cCtrlName, cFrmName ) == "EDITBOX"
* ADD two spaces to replace key TAB
FOR i := 1 TO 2
_PushKey( VK_SPACE )
NEXT
ELSE
* Next Control
InsertTab()
ENDIF
Return( Nil )
Credits: Hathinagiri
Last edited by IMATECH on Mon Jul 09, 2012 6:36 am, edited 3 times in total.
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Editbox and Tab key
Nice prototype. However just inserttab() again to simulate the tab key. Please see below:
Function F_RM_On_Key_Tab()
* Form/Window Name
local cFrmName := ThisWindow.Name()
* active control: name
local cCtrlName := ThisWindow.FocusedControl()
* Check if sender is a "Editbox"
IF GetControlType( cCtrlName, cFrmName ) == "EDITBOX"
? Do anything...
ELSE
inserttab()
ENDIF
Return( Nil )
Function F_RM_On_Key_Tab()
* Form/Window Name
local cFrmName := ThisWindow.Name()
* active control: name
local cCtrlName := ThisWindow.FocusedControl()
* Check if sender is a "Editbox"
IF GetControlType( cCtrlName, cFrmName ) == "EDITBOX"
? Do anything...
ELSE
inserttab()
ENDIF
Return( Nil )
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Editbox and Tab key
Thanks Hathinagiri !
Sample prototype updated above...
Best regards...
Sample prototype updated above...
Best regards...
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia