Quote:
> Hi,
> I would like to shut up the enter key from telling my dialog
> box to close...
> I'm programming with MFC and I don't know how to get rid of it.
> It's really bad if a user presses enter in a edit box and the whole
> dialog disappears even though you would have to click on Close
> with your mouse...
> Does anyone have a clue ?
> Regards,
> Stefan
> --
> In this EMail I expressed my own opinion, not BlueByte Software's
> opinion...
If you don't need the return key at all in your dialog, you can do
something like...
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN) {
if(pMsg->wParam == VK_RETURN)
return TRUE; // I think - also test FALSE
}
return CDialog::PreTranslateMessage(pMsg);
Quote:
}
Cecil
--
Cecil Galbraith
Free programmer's utilities and MFC tips at
http://www.concentric.net/~cgalbrai