📄 subject_28181.htm
字号:
<p>
序号:28181 发表者:James 发表日期:2003-01-18 19:22:42
<br>主题:回车转移?
<br>内容:在一个对话框程序中,为了便于输入数据,希望能在敲击回车键后焦点能从一个编辑框自动转移到另一个编辑框,这该如何实现啊?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:songxinye 回复日期:2003-01-18 19:37:58
<br>内容:http://www.copathway.com/cndevforum/subject_view.asp?subject_id=27406&forum_id=
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:upstream 回复日期:2003-01-18 20:02:07
<br>内容:重载PreTranslateMessage如下:<BR><BR>BOOL 类名::PreTranslateMessage(MSG* pMsg) <BR>{<BR> // TODO: Add your specialized code here and/or call the base class<BR> if (pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN)<BR> {<BR> DWORD def_id=GetDefID();<BR> if (def_id!=0)<BR> {<BR> CWnd *wnd=FromHandle(pMsg->hwnd);<BR> // you may implement other ways of testing, e.g.<BR> // comparing to array of cwnd*, comparing to array of ids tc.<BR> char class_name[16];<BR> if (GetClassName(wnd->GetSafeHwnd(),class_name,sizeof(class_name))!=0)<BR> {<BR> if (strnicmp(class_name,"edit",5)==0) {<BR> NextDlgCtrl();<BR> return true;<BR> // discard the message!<BR> }<BR> }<BR> }<BR> } <BR> <BR> return 类名::PreTranslateMessage(pMsg);<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -