Solved

edit box problem

Posted on 2004-04-17
7
204 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 94
while loop over for loop 7 115
scoreUp challenge 14 64
Capture logon name 13 87
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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