|
-
Dec 13th, 2002, 05:51 AM
#2
1) You need to specify the ES_WANTRETURN style for the edit box. This is some option in the properties of the edit box in the dialog editor. If you don't do that the edit box will forward the enter to the dialog box which interprets it as click on the default button, usually closing the window.
2) If you look at the API documentation of the edit control you'll notice that there is no notification that informs you of a key being pressed. You have to subclass the edit control and intercept the WM_CHAR message. In MFC you do that by deriving a class from CEditCtrl and adding a control variable (through the wizard) to the dialog that is of the type of your derived class. In your classes message map you can then intercept WM_CHAR. Don't forget to forward the message, else the edit box will lose its functionality.
Btw, neither of those were MFC questions...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|