Enter key as tab key

Enter key as tab key

cacciatore's picture

Is it possible to use the enter key after typing a value in an edit box, so the cursor goes to another edit box ( or to another component, following the tab order) ?
I am using CVF PE 6.6B
Thanks,
Geraldo

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Jugoslav Dujic's picture

Yes. The simplest method is:

1) Remove "Default button" style from the IDOK button;
2) Add another button, say, "ID_NEXT". Uncheck "visible" and "tab stop" and add "Default button" style.
3) Add & DlgSetSub the following callback for it:

SUBROUTINE OnNext(Dlg,ID,iEvent)
USE DFLOGM
USE DFWIN, ONLY: SendMessage, WM_NEXTDLGCTL
TYPE(DIALOG):: Dlg
INTEGER::      ID,iEvent,iSt
iSt = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 0, 0)
END SUBROUTINE OnNext


The idea is that the default button callback is called on Enter key; in it, just tell the dialog to set the focus to the next control.

Jugoslav

Jugoslav www.xeffort.com
cacciatore's picture

Thanks, (once again)
Geraldo

Login to leave a comment.