Solved

Trapping Enter key in Combobox in Toolbar ?

Posted on 1997-07-25
2
542 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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 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