Hi,
I try to send massage in the textbox by pressing enter key
but i have two text box, I want to send only the text in
the text box where the cursor in, but I can't understand
the function of getcaretpos. anyone can help with some code?
Thank.
#COMPILE EXE
#INCLUDE "win32api.inc"
%ID_txt1 = 101
%ID_txt2 = 102
CALLBACK FUNCTION TrickBut
'getcaretpos() 'how to?
MSGBOX "" 'show the the text in either ID_txt1 or ID_txt2
' depend on the caret(cursor) at which box
END FUNCTION
FUNCTION PBMAIN () AS LONG
LOCAL hdlg AS LONG
DIALOG NEW 0, " The Enter key ", 100, 100, 100, 100, _
%WS_SYSMENU,TO hdlg
CONTROL ADD TEXTBOX, hdlg, %ID_txt1, "", 25, 20, 50, 14
CONTROL ADD TEXTBOX, hdlg, %ID_txt2, "", 25, 50, 50, 14
'put the button outside the window area to trap the enter key.
CONTROL ADD BUTTON, hdlg, 100, "", 150, 80, 0, 0, %BS_DEFAULT _ CALL TrickBut
DIALOG SHOW MODAL hdlg
END FUNCTION
I try to send massage in the textbox by pressing enter key
but i have two text box, I want to send only the text in
the text box where the cursor in, but I can't understand
the function of getcaretpos. anyone can help with some code?
Thank.
#COMPILE EXE
#INCLUDE "win32api.inc"
%ID_txt1 = 101
%ID_txt2 = 102
CALLBACK FUNCTION TrickBut
'getcaretpos() 'how to?
MSGBOX "" 'show the the text in either ID_txt1 or ID_txt2
' depend on the caret(cursor) at which box
END FUNCTION
FUNCTION PBMAIN () AS LONG
LOCAL hdlg AS LONG
DIALOG NEW 0, " The Enter key ", 100, 100, 100, 100, _
%WS_SYSMENU,TO hdlg
CONTROL ADD TEXTBOX, hdlg, %ID_txt1, "", 25, 20, 50, 14
CONTROL ADD TEXTBOX, hdlg, %ID_txt2, "", 25, 50, 50, 14
'put the button outside the window area to trap the enter key.
CONTROL ADD BUTTON, hdlg, 100, "", 150, 80, 0, 0, %BS_DEFAULT _ CALL TrickBut
DIALOG SHOW MODAL hdlg
END FUNCTION
Comment