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
Solved

Doesn't work for ComboBox with KEYDOWN

Posted on 2000-03-08
6
610 Views
Last Modified: 2013-11-20
Hi pagladasu,

   I tried to trapping on ListBox that it worked but on ComboBox no worked,please tell me too.

   Regards,
   Aroon
0
Comment
Question by:Berm
  • 4
  • 2
6 Comments
 

Author Comment

by:Berm
ID: 2603196
Adjusted points to 10
0
 

Author Comment

by:Berm
ID: 2603197
Hi everyone,

    Would you help me too.
    From pagladasu's information that cann't trap with keydown on combobox,as when press enter key on it no reaction but listbox it's OK.

    Who can help me ?

    Please !!!

    Regards,
    Berm
0
 

Accepted Solution

by:
namrata earned 10 total points
ID: 2611859
I hope you are writing your code in WM_KEYDOWN event. is it true? Instead, you need to write code in PretranslateMessage event.  Catch WM_KEDOWN in pretranslatemessage. it should work. Here is the code :

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
CWnd* pWnd = GetFocus();
if(pWnd->GetDlgCtrlID() == IDC_COMBOBOX) {
    switch (pMsg->message)
     {
      case WM_KEYDOWN :
        switch(pMsg->wParam) {
                   case VK_RETURN :
              // write your code
                    break;
                }
               break;
     }
}
}

Hope this helps,
Namrata                         
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Berm
ID: 2648414
Hi Namrata or Anyone,

    Thanks!
     OK,it worked but VK_RETURN id program was unknown when i changed with "13",so it worked

   Why did it no work with VK_RETURN id ?

   Would you tell me please?

   Regards,
   Berm

NOTE : I accepted your answer and  selected an appropriate grade for you is "A"
0
 

Expert Comment

by:namrata
ID: 2648683
Hi Berm,

Thanks for the points and grade.

I am also surprised why VK_RETURN is not working. In your winuser.h file, there should be following line :
#define VK_RETURN         0x0D
is it there? I am novice in MFC programming. so i will try to find out an answer.

Thanks again,
Namrata
0
 

Author Comment

by:Berm
ID: 2651872
Hi Namrata,
 
     Yes,it is.
     Never mind !
    You will be The Novice or The Expert;i don't care.

    Because your answer post me that it's a Great help from you to me,so i think you're THE HELPER for me.

    Also thanks again if you will try to find out an answer for me.

      Sincerely,
      Berm


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 128
Generic progress indicator 6 117
either24  challenge 19 101
Use of condition with 'serial' in ansible 2 71
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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