在textbox的setfocus事件中设置初始值;在该窗体类中添加BOOL PreTranslateMessage(MSG *pMsg)方法,通过override它来把光标置尾。函数体如下:
if (pMsg->message == WM_LBUTTONDOWN)
{
if (pMsg->hwnd == m_ctr_editboxMsg.m_hWnd)
{
m_ctr_editboxMsg.SetFocus();
m_ctr_editboxMsg.SetSel(-1);
return TRUE; }
}
return CDialog::PreTranslateMessage(pMsg);
if (pMsg->message == WM_LBUTTONDOWN)
{
if (pMsg->hwnd == m_ctr_editboxMsg.m_hWnd)
{
m_ctr_editboxMsg.SetFocus();
m_ctr_editboxMsg.SetSel(-1);
return TRUE; }
}
return CDialog::PreTranslateMessage(pMsg);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货