Click to See Complete Forum and Search --> : Edit control


merre
May 16th, 1999, 04:09 AM
Hi!

In this project that i have, on a edit control, i have to write only 24 letters and then change the row. How can i do that?

please help me.

ric
May 17th, 1999, 04:01 AM
Ok, I am not sure if this is best, but it is a pretty sure and bugless way to do it. First, override the PreTranslateMessage(MSG* pMsg) function of your dialog class like this:

int PretranslateMessage(MSG* pMsg)
{
int ret = CDialog::PretranslateMessage(pMsg);


if(pMsg->message==WM_CHAR)
{
UpdateData(TRUE);
if(m_edit.GetLength()==24)
{
ChangeRow();
}
}

return r;
}