Capturing Carriage Return in CEdit
-
How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
Check out, http://www.codeguru.com/editctrl/edit\_cr.shtml Make sure you read the comments at the bottom. ================== The original message was: How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
-
How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
The following code will convert CR to a TAB for jumping to the next control and only when the OK button has focus CR will close the dialog. void CMyDlg:: OnOK() { CWnd *pWnd = GetFocus(); ASSERT (pWnd); if (IDOK == pWnd ->GetDlgCtrlID()) { CDialog::OnOK(); } else { NextDlgCtrl(); } } ================== The original message was: How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?