树形控件响应Enter消息,结束编辑控件的编辑
2008-07-28 10:25
369 查看
BOOL CMyXxx::PreTranslateMessage(MSG* pMsg)
{
// If edit control is visible in tree view control, when you send a
// WM_KEYDOWN message to the edit control it will dismiss the edit
// control. When the ENTER key was sent to the edit control, the
// parent window of the tree view control is responsible for updating
// the item's label in TVN_ENDLABELEDIT notification code.
if (pMsg->message == WM_KEYDOWN &&
pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
{
CEdit* edit = m_TreeCtrl.GetEditControl();
if (edit)
{
edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam);
return TRUE;
}
}
// CXxxx can be a CFormView, Cdialog, or CPropertyPage class.
return CXxxx::PreTranslateMessage(pMsg);
}
{
// If edit control is visible in tree view control, when you send a
// WM_KEYDOWN message to the edit control it will dismiss the edit
// control. When the ENTER key was sent to the edit control, the
// parent window of the tree view control is responsible for updating
// the item's label in TVN_ENDLABELEDIT notification code.
if (pMsg->message == WM_KEYDOWN &&
pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
{
CEdit* edit = m_TreeCtrl.GetEditControl();
if (edit)
{
edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam);
return TRUE;
}
}
// CXxxx can be a CFormView, Cdialog, or CPropertyPage class.
return CXxxx::PreTranslateMessage(pMsg);
}
相关文章推荐
- VC对话框中树形控件节点编辑响应回车事件完成编辑
- Winform中Datagrid编辑状态下textBox控件不响应Enter按钮的解决方案
- ListControl控件怎么响应双击消息
- 如何使得OCX控件能响应PreTranslateMessage消息?
- MFC动态创建控件及其消息响应函数
- Edit Control 编辑框控件之EN_KILLFOCUS消息使用 笔记
- TextBox控件按Enter或Ctrl+Enter键发送消息的实现
- 怎样在vs2010里面实现两个编辑控件对应一个消息处理函数
- 动态创建的CListCtrl控件的消息响应
- OCX控件响应PreTranslateMessage消息的步骤
- 【VS开发】MFC CListCtrl列表控件的消息响应
- VC中动态添加控件,并且响应控件的消息
- 动态创建控件的消息响应添加
- 有几个控件的操作时有关联关系,一个对话框中有多组这样的控件群,各个组中的控件的消息响应处理非常类似,以下提供解决方案
- MFC单文档添加控件和消息响应函数
- C++如何通过一个响应事件接受多个控件消息
- 使得OCX控件响应PreTranslateMessage消息的步骤
- MFC中如何让一个CStatic控件响应消息
- MFC 动态创建控件及添加消息响应函数
- 使得OCX控件响应PreTranslateMessage消息的步骤