Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6127687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:32:24+00:00 2026-05-23T16:32:24+00:00

When the user clicks the OK or APPLY button on a property sheet and

  • 0

When the user clicks the OK or APPLY button on a property sheet and the program determines data on some page is invalid, how can I cause the page containing the error to be displayed along with a message box describing the error?

Currently the procedure doing the validation does the following while processing the PSN_APPLY notification.

MessageBox (hDlg, "Data must be positive!", "Error", MB_OK);
SetWindowLong (hDlg, DWL_MSGRESULT, PSNRET_INVALID);

This works ok if the page doing the validation (A) is currently displayed but if some other page (B) is being displayed, the message box appears with that page (B) being displayed, then when the message box is answered, the page with the validation error (A) is displayed. I thought about setting some flag so that when that page (A) gets the PSN_SETACTIVE notification it displays the message box but that seems kind of hokey.

Win32 API in c++, no MFC, no NET, nothing fancy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:32:25+00:00Added an answer on May 23, 2026 at 4:32 pm

    I think the problem is in the design of your validation and it’s presentation.

    Am I right in thinking that you iterate through your property sheets, validate them and display a message box if something is awry? Because of course, what you have witnessed will happen, if I am on property page 3 and I wrote crap in to a field on property page 1.

    The easiest solution is, when validating, note which property page the field in question is, and set that one active if the user has written crap in to one of your fields. This seems the fastest way possible.

    Also, rather than spring up an annoying message box, reserve some room beneath the property pages to display a textual (red or otherwise) warning as to why, and then change to the appropriate property page, and highlight the offending control. Your validation routine can do this nice and easily as it loops through.

    Even better, don’t stop at the first error. One thing I HATE is correcting one field that I think is the only issue, only to be told every time I hit “OK” or “SUBMIT” that there’s something else I missed.

    I seriously think you should consider going the extra mile here… loop through ALL controls, and add all invalid ones to a list. Then change each offending control’s background colour, tab colour etc… Then the user can work through and correct, no matter how many errors he or she made.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Details: Only disable after user clicks the submit button, but before the posting back
When a user clicks on an image on a web page, I'd like to
When a user clicks a submit button I want the form to be submitted.
When the user clicks a button, I want his browser to automatically scroll to
As soon as the user clicks the delete button my jQuery script asks the
When a user clicks on a button or link, I use the SimpleModal jQuery
In the tableview the user can tap the upper right button (navigation bar rightside)
I have an AuthorizationServlet which is called when user click button in login page.
Alright, I am trying to accomplish this: When a user clicks a button that
In my iPhone app I have a settings page where a user can enter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.