Results 1 to 2 of 2

Thread: problematic "Enter" n "Space bar"

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    in e middle of nowhere..
    Posts
    40

    Cool 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!!!!!


  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width