Solved

edit box problem

Posted on 2004-04-17
7
196 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
either24  challenge 19 84
modThree challenge 4 64
sumHeights2  challenge 7 76
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 84
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now