Solved

How to change the default Ok behavior in a propertysheet

Posted on 1997-02-21
3
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 130 total points
ID: 1300519
You can override CPropertyPage::OnOK().

0
 

Author Comment

by:mfc022197
ID: 1300520
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
ID: 1300521
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

728 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