Solved

Trapping Enter key in Combobox in Toolbar ?

Posted on 1997-07-25
2
541 Views
Last Modified: 2013-11-20
I'm trying to trap the enter key in the editbox portion of a combobox located in a toolbar. I've created my own combobox class from CCombobox and added handlers for keyup, keydown and wmchar to no avail. Could anyone advise ?
0
Comment
Question by:johand
[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 Comments
 

Accepted Solution

by:
ajh020797 earned 100 total points
ID: 1302797
Try watching the messages that go through PreTranslateMessage, if a WM_CHAR,WM_KEYUP, or WM_KEYDOWN message is sent it will get it before the control has time to filter it out.
0
 

Expert Comment

by:tflex
ID: 1302798
I am using this for all 'Edit' controls in my toolbars

BOOL CMyToolBar::PreTranslateMessage(MSG* pMsg)
  {
  if (pMsg->message == WM_KEYDOWN)
    {
    switch (pMsg->wParam)
      {
      case 27:  //Escape
       .......
      case 13: //Enter
      .......
      }
    }
  return CDialogBar::PreTranslateMessage(pMsg);
  }

0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 71
notReplace  challenge 53 153
viewing source code from eclipse 13 111
Unix Command -- Challenging  question 7 107
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

752 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