• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

How to change the default Ok behavior in a propertysheet

In my application that uses a property sheet with property pages, I want to change the ENTER key to act as a TAB, instead of trigging the Ok button. I have tried to use a WH_KEYBOARD hook in a class derived from CPropertyPage and change the keyboard character from VK_RETURN to VK_TAB in the KeyboardProc, but that doesn't work. I can't figure out why, because you can disable the action by returning nonzero instead of calling CallNextHookEx.
0
mfc022197
Asked:
mfc022197
  • 2
1 Solution
 
chensuCommented:
You can override CPropertyPage::OnOK().

0
 
mfc022197Author Commented:
But at that time it's too late to inhibit the action or change the keyboard code.

/Arne
0
 
chensuCommented:
I mean you don't need to change the keyboard code. In your own CPropertyPage::OnOK(), you can call CPropertyPage::NextDlgCtrl() to simulate the TAB action (CPropertyPage is derived from CDialog, so the member function NextDlgCtrl() is also the member function of CPropertyPage).

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now