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. wizard finish button and message box

wizard finish button and message box

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • M Offline
    M Offline
    misha_grewal
    wrote on last edited by
    #1

    I have a property sheet with wizard style. At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled. But if I put a message box before calling the SetWizardButton routine, it works. I tried with invalidate method so as to refresh the current windows, but I guess I am missing something. Any pointers? evil triumphs when good people sit quiet..

    D 1 Reply Last reply
    0
    • M misha_grewal

      I have a property sheet with wizard style. At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled. But if I put a message box before calling the SetWizardButton routine, it works. I tried with invalidate method so as to refresh the current windows, but I guess I am missing something. Any pointers? evil triumphs when good people sit quiet..

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      misha_grewal wrote:

      The code doesn't work and the Finish button is enabled.

      What does the code look like?


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      M 1 Reply Last reply
      0
      • D David Crow

        misha_grewal wrote:

        The code doesn't work and the Finish button is enabled.

        What does the code look like?


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        M Offline
        M Offline
        misha_grewal
        wrote on last edited by
        #3

        oK I digged into the problem a little bit Is it a message queue problem? Code === pWizard->SetWizardButtons(PSWIZB_BACK); CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE); } but if you put a message box before the call, it works, as in if (pButton) { AfxMessageBox(_T("text")); // this call now WORKS pButton->EnableWindow(FALSE); } Code ends == On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box. What happens in EnableWindow?

        D 1 Reply Last reply
        0
        • M misha_grewal

          oK I digged into the problem a little bit Is it a message queue problem? Code === pWizard->SetWizardButtons(PSWIZB_BACK); CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE); } but if you put a message box before the call, it works, as in if (pButton) { AfxMessageBox(_T("text")); // this call now WORKS pButton->EnableWindow(FALSE); } Code ends == On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box. What happens in EnableWindow?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          misha_grewal wrote:

          CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE);

          Why aren't you using:

          pWizard->SetWizardButtons(PSWIZB_DISABLEDFINISH);


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          M 1 Reply Last reply
          0
          • D David Crow

            misha_grewal wrote:

            CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE);

            Why aren't you using:

            pWizard->SetWizardButtons(PSWIZB_DISABLEDFINISH);


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            M Offline
            M Offline
            misha_grewal
            wrote on last edited by
            #5

            Thanks much it works with this call i m really stupid

            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