CEdit 光标设置

来源:互联网 发布:广州淘宝模特联系方式 编辑:程序博客网 时间:2024/05/22 07:40

CEdit 设置光标当前位置在编辑框最后
在OnInitDialog中设置,返回值应为FALSE
方法1. 
m_Edit.SendMessage(WM_KEYDOWN, VK_END, 0);
m_Edit.SetFocus();
   
方法2.
CString strInfo;
m_Edit.GetWindowText(strInfo);
int nLength = strInfo.GetLength();
m_Edit.SetSel(nLength,nLength, FALSE);
m_Edit.SetFocus();