RichEdit 中tab键的输入 (急!!!!!!!!) 请教:我在Richedit中按下tab键时会全选控件中的文本,而不是输入'\t',应该如何设置多多帮忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if(nChar == 0x09) { CString str="\t"; CHARRANGE crPos; GetSel(crPos); if (crPos.cpMin != crPos.cpMax) { SetSel(crPos.cpMin, crPos.cpMax); } else { SetSel(crPos.cpMax, crPos.cpMax); } ReplaceSel(str); return; }代码加入到onkeydown()消息中. 重载PreTranslateMessage(MSG* pMsg) BOOL CTestDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_KEYDOWN && pMsg->wParam == VK_TAB) { if(m_rich.GetSafeHwnd()==GetFocus()->GetSafeHwnd()) { m_rich.ReplaceSel("\t"); return TRUE; } } return CDialog::PreTranslateMessage(pMsg);} Progress Bar Controls怎么使用Visual Styles 宽度国际信息股份有限公司招聘。(北京) 键盘消息的问题 怎样搜索数据库里的时间最靠前的几条记录? char ? 关于开发工具~~ 初学者的困惑 ************怎样给CRichEditView加入背景************* 资源中很多不同用途的对话框,如何在资源对话框文件加下再建立文件夹,进行分类?谢谢! Install Shield For VC6怎么用?(最好有操作步骤) 请教关于VC多线程访问串口的实现方法。 请问javascript怎么响应控件的事件?
{
CString str="\t";
CHARRANGE crPos;
GetSel(crPos);
if (crPos.cpMin != crPos.cpMax)
{
SetSel(crPos.cpMin, crPos.cpMax);
}
else
{
SetSel(crPos.cpMax, crPos.cpMax);
} ReplaceSel(str);
return;
}
代码加入到onkeydown()消息中.
BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_KEYDOWN && pMsg->wParam == VK_TAB)
{
if(m_rich.GetSafeHwnd()==GetFocus()->GetSafeHwnd())
{
m_rich.ReplaceSel("\t");
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}