Combining user error notification with focus switch

Oct 28, 2009 at 8:31 PM

Currently, I make use of the base objects to implement validation as well as notification functionality.  Using ErrorProviders I can easily notify user of errors in input? What sort of possibility to combine this notification of error along with changing focus on a form?

To better explain, my scenario involves a form with multiple tabs, where each tab has 10-12 numeric input fields.  The form itself is always invoked modally and has edit functionality that is closed out using Ok or Cancel handlers.  What I would like to allow is for the user to move between tabs, editing values, being notified of errors, etc.  When they close the form via Ok, I invoke validation via PropertyValidationManager::ValidateAllProperties.  If any errors occur, a dialog notifies and cancels out of the Ok handler, i.e. errors must be fixed if user wants to successfully close form (Cancel is an option of course).

What combining focus change with the validation would do is allow me to push the user to the error that needs to be corrected.  This is especially useful if they've navigated off a tab that has an error.  Notify them of errors when Ok is pressed, and then switch to the tab/field that has actual error.

This requires somehow working backwards from error messages to controls.  Is this possible?  Is there a way to iterate through all controls on a field and determine their status with regards to the validation framework?