I have the following code snippet.
I can get text from it just fine, but I need to
capture it after the user presses enter.
It's just in the Test stage, that's why the msgbox.
SUB enterKey()
CONTROL ADD TEXTBOX, hDlg, %id_Company, "", 68, 17, 42, 12, %ES_WANTRETURN, %WS_EX_LEFT CALL EnterKeyCallBack
CONTROL SET FOCUS hDlg,%Id_Company
END SUB
CALLBACK FUNCTION EnterKeyCallBack
CONTROL GET TEXT hDlg, %ID_Company TO key$
'IF %IDOK AND LEN(key$) THEN
IF len(key$)=6 THEN
MSGBOX key$
END IF
END FUNCTION
I can get text from it just fine, but I need to
capture it after the user presses enter.
It's just in the Test stage, that's why the msgbox.
SUB enterKey()
CONTROL ADD TEXTBOX, hDlg, %id_Company, "", 68, 17, 42, 12, %ES_WANTRETURN, %WS_EX_LEFT CALL EnterKeyCallBack
CONTROL SET FOCUS hDlg,%Id_Company
END SUB
CALLBACK FUNCTION EnterKeyCallBack
CONTROL GET TEXT hDlg, %ID_Company TO key$
'IF %IDOK AND LEN(key$) THEN
IF len(key$)=6 THEN
MSGBOX key$
END IF
END FUNCTION
Comment