+ -
当前位置:首页 → 问答吧 → 基于对话框的EN_CHANGE不响应是怎么回事

基于对话框的EN_CHANGE不响应是怎么回事

时间:2011-12-20

来源:互联网

void CNotebookDlg::OnChangeRichedit1() 
{
// 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.
CString strText="";
m_RichEdit.GetWindowText(strText);
if(strText=="")  
{
m_ToolBar.GetToolBarCtrl().EnableButton(ID_EDIT_COPY,FALSE); 
m_ToolBar.GetToolBarCtrl().EnableButton(ID_EDIT_CUT,FALSE);
}
else 
{
m_ToolBar.GetToolBarCtrl().EnableButton(ID_EDIT_COPY,TRUE); 
m_ToolBar.GetToolBarCtrl().EnableButton(ID_EDIT_CUT,TRUE);
}
// TODO: Add your control notification handler code here

}
预想功能:用onchange判断编辑框内是否有内容,无内容时将工具栏中的 复制 剪切 置灰,有内容时则恢复。
但是没有反应呀。。。。

作者: ccmoon123   发布时间: 2011-12-20

up 求回复

作者: ccmoon123   发布时间: 2011-12-20