Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to accept Enter key in Button control.

How to accept Enter key in Button control.

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiotutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    birajendu
    wrote on last edited by
    #1

    I have created a Dialog using Visual studio 2003. in that dialog i have couple of control buttons. And those buttons are in tab stop order. In 1st tab stop 1st button is focused, and if i click space bar than it got clicked. So i expect the enter click should work in the same way when the button is focused. Is there any other property need to set to acheive that.... thanks in advance.....

    Birajendu SonicWALL Bangalore India

    B 1 Reply Last reply
    0
    • B birajendu

      I have created a Dialog using Visual studio 2003. in that dialog i have couple of control buttons. And those buttons are in tab stop order. In 1st tab stop 1st button is focused, and if i click space bar than it got clicked. So i expect the enter click should work in the same way when the button is focused. Is there any other property need to set to acheive that.... thanks in advance.....

      Birajendu SonicWALL Bangalore India

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      Look at the BS_DEFPUSHBUTTON style. The button that has this style is what is invoked (clicked) when you hit enter.

      onwards and upwards...

      B 1 Reply Last reply
      0
      • B basementman

        Look at the BS_DEFPUSHBUTTON style. The button that has this style is what is invoked (clicked) when you hit enter.

        onwards and upwards...

        B Offline
        B Offline
        birajendu
        wrote on last edited by
        #3

        Thanks for the quick reply. But in VC++ IDE i did not get the button style property, I think i can do some thing like sendmessage() to the pertucular button to chnage style but i dont how to do that that. Do you have any idea? Thanks in advance....

        Birajendu SonicWALL Bangalore India

        B 1 Reply Last reply
        0
        • B birajendu

          Thanks for the quick reply. But in VC++ IDE i did not get the button style property, I think i can do some thing like sendmessage() to the pertucular button to chnage style but i dont how to do that that. Do you have any idea? Thanks in advance....

          Birajendu SonicWALL Bangalore India

          B Offline
          B Offline
          basementman
          wrote on last edited by
          #4

          In the dialog editor, look for the Default Button checkbox option.

          onwards and upwards...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups