I want to change the data and display when I hit enter in the edit control box in the dialog. Is there any way I can do that??
Thanks.
Amy
Printable View
I want to change the data and display when I hit enter in the edit control box in the dialog. Is there any way I can do that??
Thanks.
Amy
You must predefine your OnOK() function first so that it won't close your dialog every time you press Enter like that CMyDialog::OnOK() {}
Just define OnClickedOK() for example. After that handle the message WM_CHAR and do you stuff in OnChar();
Another way...
Derive new class from class CEdit
class CMyEdit : public CEdit
{
...
afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
}
and overwrite there virtual function : OnChar
inside this function check if enter was pressed
But u wont be able to set this control using
Class Wizard... U ll need to set it in : OnInitDialog function or :OnInitialUpdate