Edit Control
-
Hi I have an edit control which i have a character counter on this works fine, but when i exceed 256 chars the cursor jumps to the start of the edit control For my counter i am using void CMyMessagePage::OnEnChangeEMsg() { UpdateData(TRUE); int nBytes = lstrlen(m_message); CString len; len.Format("%d",nBytes); m_sms_written = len; UpdateData(FALSE); } Can anyone help thanks Simon
-
Hi I have an edit control which i have a character counter on this works fine, but when i exceed 256 chars the cursor jumps to the start of the edit control For my counter i am using void CMyMessagePage::OnEnChangeEMsg() { UpdateData(TRUE); int nBytes = lstrlen(m_message); CString len; len.Format("%d",nBytes); m_sms_written = len; UpdateData(FALSE); } Can anyone help thanks Simon
Check out SetLimitText(UINT /*param*/) API
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Check out SetLimitText(UINT /*param*/) API
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Hi I have an edit control which i have a character counter on this works fine, but when i exceed 256 chars the cursor jumps to the start of the edit control For my counter i am using void CMyMessagePage::OnEnChangeEMsg() { UpdateData(TRUE); int nBytes = lstrlen(m_message); CString len; len.Format("%d",nBytes); m_sms_written = len; UpdateData(FALSE); } Can anyone help thanks Simon
Hi There are some problems with UpdateData(true) / UpdateData(false) and you may lose your position if the system thinks the string has changed in the process (it happens also with numbers and decimal points etc) ... you can use CEdit::GetSel and CEdit::SetSel to save and reset your cursor position... hope this helps!
-
Hi There are some problems with UpdateData(true) / UpdateData(false) and you may lose your position if the system thinks the string has changed in the process (it happens also with numbers and decimal points etc) ... you can use CEdit::GetSel and CEdit::SetSel to save and reset your cursor position... hope this helps!