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. Default button

Default button

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 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.
  • S Offline
    S Offline
    Stan the man
    wrote on last edited by
    #1

    Hi. I was wondering if anyone knows how to retain the default button function on a dialog? After I push the cancel button, if I show the dialog again (showwindow), the OK button no longer has the default "status" and so pushing the return button after entering something into an edit box does not automatically push OK but Cancel now. Is there a way that when I show the window,I force teh OK button to have teh default button status everytime? Thanks in advance! Stan the man

    M 1 Reply Last reply
    0
    • S Stan the man

      Hi. I was wondering if anyone knows how to retain the default button function on a dialog? After I push the cancel button, if I show the dialog again (showwindow), the OK button no longer has the default "status" and so pushing the return button after entering something into an edit box does not automatically push OK but Cancel now. Is there a way that when I show the window,I force teh OK button to have teh default button status everytime? Thanks in advance! Stan the man

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You can use the WM_NEXTDLGCTL message to move focus and default state to the pushbutton you desire.  That, BTW, is the proper message to use to set focus to any dialog control. See here[^] for details... Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        You can use the WM_NEXTDLGCTL message to move focus and default state to the pushbutton you desire.  That, BTW, is the proper message to use to set focus to any dialog control. See here[^] for details... Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        Stan the man
        wrote on last edited by
        #3

        That was perfect, just want I need it. Thanks, Stan the man

        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