-
May 23rd, 2002, 04:56 AM
#1
CEditbox
Hi, How do I determine when the user has finished entering text in an edit box. In other words, how do I know he has pressed the enter key and has completed typing in the text.
-
May 23rd, 2002, 05:10 AM
#2
Hi,
You cannot trap enter from an edit box in the parent, you need to
derive a new class from CEdit and process the WM_CHAR mesgs
-
May 23rd, 2002, 05:16 AM
#3
You can also handle the WM_KILLFOCUS message.
regards,
MiMec
-
May 23rd, 2002, 05:22 AM
#4
If the edit control is in a dialog you can use classwizard to process the EN_CHANGE or the EN_UPDATE message of the edit control.
Then you can access the data of the Edit control and check if the last character is '\n'
-
May 23rd, 2002, 05:24 AM
#5
If this is a single line edit box, it cannot have a '\n' at the end.
regards,
MiMec
-
May 23rd, 2002, 05:33 AM
#6
Thank you, but i cannot access the onKillFoucs event just by pressing the Enter key, i tryed the onKeyDown for the dialog but i had no result.
What do you think might be the solution?
thank you for your time
-
May 23rd, 2002, 05:43 AM
#7
When you press ENTER in a dialog, it activates the default button, so if you have an OK button the dialog will be closed. KillFocus is sent when the user deactivates the control (by pressing TAB or clicking somewhere in the dialog) - this way the window is not closed.
regards,
MiMec
-
May 23rd, 2002, 06:09 AM
#8
Thanks but i still wonder how to work with the onKeyDown event!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|