|
-
Sep 4th, 2002, 01:48 AM
#1
Thread Starter
Member
problematic "Enter" n "Space bar"
hello! its me again...
my VC program is kinda funny...
its MFC Dialog box by the way.....
when i run the program, ,,,,,
if i press either enter or space,, the exe ,, it closes itself!!!
i tried all those onChar methods but it doesn't work!!!
help me!!!
i really dunno how to handle that!!
thankzzz a million!!!!!
-
Sep 4th, 2002, 02:31 AM
#2
This is because Enter and Space tell your dialog that the default button was clicked. Try intercepting the WM_KEYDOWN and WM_KEYUP messages.
An multiline edit box will capture spaces, but not enter (only Ctrl+Enter), unless you specify the ES_WANTRETURN style or check the "Want Return" box in the properties. A single-line edit box will only capture space.
Most other controls will capture space if they are selected and act as if the selected item was clicked. This applies to buttons, radios, checks, selects, combos etc.
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
|