Solved

How to change the default Ok behavior in a propertysheet

Posted on 1997-02-21
3
216 Views
Last Modified: 2013-11-20
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
Comment
Question by:mfc022197
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 130 total points
Comment Utility
You can override CPropertyPage::OnOK().

0
 

Author Comment

by:mfc022197
Comment Utility
But at that time it's too late to inhibit the action or change the keyboard code.

/Arne
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop error 4 77
Strange date stored 22 99
sumNumber challenge 16 98
VBA "SendKeys" Syntax for Multiple Keystrokes 7 97
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now