在CGridCtrl中,请问如何用回车键实现使其输入焦点转移到下一个单元格?谢谢

lj1006 2010-03-26 09:23:40
在CGridCtrl中,用TAB键可以实现使其输入焦点转移到下一个单元格,请问如何用回车键实现使其输入焦点转移到下一个单元格?谢谢
...全文
78 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
huliang66 2010-03-26
  • 打赏
  • 举报
回复
添加对话框的虚函数 virtual BOOL PreTranslateMessage(MSG* pMsg);

函数里写:

BOOL CMy1Dlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN)
{
if (pMsg->wParam==VK_RETURN)
pMsg->wParam=VK_TAB; //TRUE :截获消息,换掉。
}
return CDialog::PreTranslateMessage(pMsg);
}

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧