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. Suppressing Next button on wizard

Suppressing Next button on wizard

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 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.
  • L Offline
    L Offline
    Lilian Chan Grant
    wrote on last edited by
    #1

    I hope I can explain this without too much confusion. Let's say you have an edit box in a wizard. You enter data outside the valid range. If you click Enter instead of Tab, you get an error message. If you click on Enter to dismiss the error, it acts like an Enter and goes onto the Next screen. The original code looked like this: // Check the validity of the value l_lVal = atof((_bstr_t)InBurstLengthStr); if((l_lVal > m_dMaxBurstLength) || (l_lVal < m_dMinBurstLength)) { // If the entered value is out of range then throw an error ::MessageBox(m_hWnd, L"The Burst Length Entered is not Within the Specified Range!", L"Data Entry Error",MB_OK | MB_ICONEXCLAMATION); BurstLengthEdit.SetFocus(); return 0; } I changed it so that I got the click. I checked if the click was IDOK, called the setfocus, but that didn't help. I saw where someone else made the enter key act like a tab key if they were in an edit field with a hook. I couldn't get that to work. It just wanted to act like a Next, which was weird because it didn't appear to be the default button. Please HELP me if you can! Thanks, Lilian

    T 1 Reply Last reply
    0
    • L Lilian Chan Grant

      I hope I can explain this without too much confusion. Let's say you have an edit box in a wizard. You enter data outside the valid range. If you click Enter instead of Tab, you get an error message. If you click on Enter to dismiss the error, it acts like an Enter and goes onto the Next screen. The original code looked like this: // Check the validity of the value l_lVal = atof((_bstr_t)InBurstLengthStr); if((l_lVal > m_dMaxBurstLength) || (l_lVal < m_dMinBurstLength)) { // If the entered value is out of range then throw an error ::MessageBox(m_hWnd, L"The Burst Length Entered is not Within the Specified Range!", L"Data Entry Error",MB_OK | MB_ICONEXCLAMATION); BurstLengthEdit.SetFocus(); return 0; } I changed it so that I got the click. I checked if the click was IDOK, called the setfocus, but that didn't help. I saw where someone else made the enter key act like a tab key if they were in an edit field with a hook. I couldn't get that to work. It just wanted to act like a Next, which was weird because it didn't appear to be the default button. Please HELP me if you can! Thanks, Lilian

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      The code you've posted is located in some event handler; you didn't include the function header. Which event is it? Tomasz Sowinski -- http://www.shooltz.com

      *** Si fractum non sit, noli id reficere. ***

      L 1 Reply Last reply
      0
      • T Tomasz Sowinski

        The code you've posted is located in some event handler; you didn't include the function header. Which event is it? Tomasz Sowinski -- http://www.shooltz.com

        *** Si fractum non sit, noli id reficere. ***

        L Offline
        L Offline
        Lilian Chan Grant
        wrote on last edited by
        #3

        The method name is OnKillFocusBurstLengthEdit, EN_SETFOCUS.

        T 1 Reply Last reply
        0
        • L Lilian Chan Grant

          The method name is OnKillFocusBurstLengthEdit, EN_SETFOCUS.

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          EN_KILLFOCUS handler doesn't give you any control over page navigation. I *guess* (never did that personally) you should check values in OnWizardNext and return -1 if they don't satisfy your conditions. Tomasz Sowinski -- http://www.shooltz.com

          *** Si fractum non sit, noli id reficere. ***

          L 1 Reply Last reply
          0
          • T Tomasz Sowinski

            EN_KILLFOCUS handler doesn't give you any control over page navigation. I *guess* (never did that personally) you should check values in OnWizardNext and return -1 if they don't satisfy your conditions. Tomasz Sowinski -- http://www.shooltz.com

            *** Si fractum non sit, noli id reficere. ***

            L Offline
            L Offline
            Lilian Chan Grant
            wrote on last edited by
            #5

            Thanks, I knew this was something beyond my control/comprehension!

            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