the best way is to derive a class from CEdit and handle WM_CHAR. there you can do whatever you want in response to VK_RETURN, VK_ESCAPE. also make sure that in your dialog you have handlers for OK and Cancel. In those handlers comment the part with the call of the base class: void CBDlg::OnOK() { // TODO: Add extra validation here //CDialog::OnOK(); } Now your dialog will not exit when you press enter. same for OnCancel.. PS: Stay away from PreTranslate... as it's design is not for this kind of use.
M
myth7676
@myth7676