miszler.zoltan wrote:Gentlemen!
Thanks for the tips!
Sincerely, Zoltan
You are welcomed !
mol wrote:Works fine, but - if the pressing enter key on BUTTON Control, moves focus to the next control

Yes sure ! This is normal, but this can also be implemented an exception for other types.
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 450 HEIGHT 340 ;
TITLE 'HMG EditBox Demo' ;
MAIN
ON KEY RETURN ACTION OnlyForEditBox()
ON KEY ESCAPE ACTION ThisWindow.Release()
DEFINE STATUSBAR
STATUSITEM 'HMG Power Ready!'
END STATUSBAR
@ 30,10 EDITBOX Edit_1 ;
WIDTH 410 ;
HEIGHT 140 ;
VALUE 'EditBox!!' ;
TOOLTIP 'EditBox' ;
MAXLENGTH 255
DEFINE TEXTBOX Text_1
ROW 180
COL 130
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
END TEXTBOX
DEFINE TEXTBOX Text_2
ROW 220
COL 130
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
END TEXTBOX
END WINDOW
Form_1.Center()
Form_1.Activate()
Return Nil
Function OnlyForEditBox()
Local cContType := GetFocusedControlType()
If cContType == "EDIT"
_SetNextFocus()
Else
DoMethod("Form_1","Edit_1","SetFocus")
Endif
Return Nil
And if you do not want to back to EditBox, remove SetFocus line.