永发信息网

MFC中多行文本编辑框不能响应EN_CHANGE消息是什么原因

答案:2  悬赏:60  手机版
解决时间 2021-03-18 01:56
  • 提问者网友:姑娘长的好罪过
  • 2021-03-17 19:19
我的MFC对话框有多个文本编辑框,有单行的,有多行的,编译能通过,且单行的能响应EN_CHANGE消息,但是多行的却不能响应。我想知道是什么原因。我的多行文本编辑框的代码如下:
void PEIZHI::OnChangeClearOrder()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here
UpdateData(TRUE);
CString str1="LINK>";
string::size_type idx1 = m_ORDER.Find(str1);
if ( idx1 != string::npos )
{
MessageBox("找到LINK>");
}
//编辑框滚动到最后一行
UpdateData(FALSE);
//CEdit*pedit=(CEdit*)GetDlgItem(IDC_EDIT2_ORDER);
//int nline=pedit-> GetLineCount();
//pedit-> LineScroll(nline-1);
}
请问是什么原因了。
最佳答案
  • 五星知识达人网友:duile
  • 2021-03-17 20:04
Multiline True
Auto HScroll Ffalse
Auto VScroll True
Vertical Scroll True
这样设置的情况下往编辑框里面输入数据的时候会自动滚动啊,没必要响应EN_CHANG里面去LineScroll

LineScroll一般是配合SetWindowText使用的
全部回答
  • 1楼网友:躲不过心动
  • 2021-03-17 20:27
不明白啊 = =!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯