Solved

edit box problem

Posted on 2004-04-17
7
200 Views
Last Modified: 2013-11-20
while editing something in edit box, if I press "F5" key then I want to display another dialog box. how to get F5 is pressed while entering text in edit box?
0
Comment
Question by:rpatna
7 Comments
 
LVL 6

Assisted Solution

by:joghurt
joghurt earned 20 total points
ID: 10848882
You'll need to subclass the edit control, or implement the PreTranslateMessage method.
0
 

Author Comment

by:rpatna
ID: 10849023
what to do in sub class?

I tryed in PreTranslateMessage, but not working.
0
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10850112
derive a new CEdit class .... say CMyEdit ..... override the WM_KEYDOWN message and capture the F5
make your edit control a object of this new class ie CMyEdit m_editCtrl
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 5

Accepted Solution

by:
Nass89 earned 30 total points
ID: 10851918
Hi,
You may use the following code to capture th F5 Key in EditBox:
//Use AppWizard and add PreTranslateMessage to Your Dialog.

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
      // TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_KEYDOWN)
     {
      long nID = ::GetDlgCtrlID(pMsg->hwnd);
      if(nID== IDC_EDIT1 && pMsg->wParam == VK_F5)
                    AfxMessageBox("F5 pressed");
  }
      
      return CDialog::PreTranslateMessage(pMsg);
}

Good Luck!
0
 
LVL 5

Expert Comment

by:Nass89
ID: 11131996
Hi,
My answer to the question works fine.
0
 
LVL 6

Expert Comment

by:joghurt
ID: 11132485
Just as ours.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
Shell script to login to remote m/c and execute commands 10 78
sumNumber challenge 16 122
haveThree challenge 22 118
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.

777 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