给你个提示吧:BOOL CTESTDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if (pMsg->message == WM_KEYDOWN) { if ((pMsg->hwnd == this->m_list.m_hWnd )&& (pMsg->wParam == VK_RETURN)) { MessageBox("aa"); return true; } }
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN)
{
if ((pMsg->hwnd == this->m_list.m_hWnd )&&
(pMsg->wParam == VK_RETURN))
{
MessageBox("aa");
return true;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == (WPARAM) VK_RETURN)
AfxMessageBox("");
return CEdit::PreTranslateMessage(pMsg);
}在你自己EDIT中加入这一句就可以了