如何在VC++中用回车键切换输入 焦点

解决方案 »

  1.   

    在对话框中可以使用NextDlgCtrl()来自动跳到下一个焦点
      

  2.   

    在对话框的OnOK中
    if(GetFocus( ) != this) NextDlgCtrl();
      

  3.   

    BOOL CTestDlg::PreTranslateMessage(MSG* pMsg) 
    {
    if((pMsg->message==WM_KEYDOWN) && (pMsg->wParam == VK_RETURN)) {
    CWnd *m_curWnd = GetFocus();
    if(m_curWnd != NULL){
    CWnd *m_nextTable = GetNextDlgTabItem(m_curWnd);
    m_nextTable->SetFocus();

    }
    return true;
    }

    return CDialog::PreTranslateMessage(pMsg);
    }
      

  4.   

    同意 Paris_Luo(不懂) 的代码!