基于对话框的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判断编辑框内是否有内容,无内容时将工具栏中的 复制 剪切 置灰,有内容时则恢复。
但是没有反应呀。。。。
{
// 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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28