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. CPropertyPage Brain Fart!!!

CPropertyPage Brain Fart!!!

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 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.
  • C Offline
    C Offline
    Chris Hambleton
    wrote on last edited by
    #1

    Hi, Looks like I'm having a brain fart this morning and can't remember how to cancel the closing of a property sheet. I have two property pages, and I validate some settings in the CMyPropPage1::OnOk() handler. If the settings are invalid, I display a msgbox to the user and want to leave the property sheet displayed. However, it's closing after the user closes the msgbox! When the settings are invalid, I simply return from the handler (which appears to be wrong...). So, what do I have to do to keep it displayed?? Thanks! Chris _"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."

    "It does not take a majority to prevail ... but rather an irate, tireless minority, keen on setting brushfires of freedom in the minds of men." --Samuel Adams_

    T 1 Reply Last reply
    0
    • C Chris Hambleton

      Hi, Looks like I'm having a brain fart this morning and can't remember how to cancel the closing of a property sheet. I have two property pages, and I validate some settings in the CMyPropPage1::OnOk() handler. If the settings are invalid, I display a msgbox to the user and want to leave the property sheet displayed. However, it's closing after the user closes the msgbox! When the settings are invalid, I simply return from the handler (which appears to be wrong...). So, what do I have to do to keep it displayed?? Thanks! Chris _"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."

      "It does not take a majority to prevail ... but rather an irate, tireless minority, keen on setting brushfires of freedom in the minds of men." --Samuel Adams_

      T Offline
      T Offline
      Tony Fontenot
      wrote on last edited by
      #2

      Well when OnOK is called in the PropertySheet all the PropertyPageses that have been activated get their OnOK called. That means all the pages have been validated; therefor, no matter what the return is from OnOK on the Sheet it will close. Al least that is my experiance. It may be totally incorrect but it is what I tell myself to feel better. :) So what do you do? In all my PropertySheets I validate at the Page level. That way if a page fails then I show message and return there. Hope it helps. *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

      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