Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between clicking OK and pressing Return key ?

Status
Not open for further replies.

jhartridge

Programmer
Feb 20, 2004
4
GB
I have an application that uses CPropertySheets to build a tabbed dialog.

Each tabbed page has its own OnApply() function that validates the data and displays an error if one is found.

The OK on the base sheet has the focus.

Clicking on OK causes the pages' OnApply() to be called to display an error box and move the focus to the tab with the error. The over all tabbed dialog stays until the errors are cleared. When everything is all right then clicking OK causes the window to close (it's Modal) and continue.

However, if the return key is pressed instead of clicking OK any errors in the data are still displayed but the dialog closes meaning there is now no way to go back to edit it and put it right !

So I want the dialog to perform as if I clicked on OK when I press return. I do not see what the difference is ?

Any suggestions ?

John
 
On subtle difference is that when you click you also change focus, ie if you do something in OnKillFocus that might not be done when pressing return.

/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top