请问如何用回车键控制TAB顺?谢谢

解决方案 »

  1.   

    Dlg::PreTranslateMessage(MSG* pMsg) 
    {
    if(pMsg->message==WM_KEYDOWN && (pMsg->wParam == VK_RETURN))
    {
    NextDlgCtrl();
    return TRUE;
    }
      

  2.   

    谢谢,还请问一下,如果当TAB到我的某一个按扭时,此时再按回车执行按扭的功能,在怎么写啊,谢谢
      

  3.   

    还有个问题就是在FROMVIEW中提示NextDlgCtrl()没有定义是怎么回事啊
      

  4.   

    BOOL CDialogList1::PreTranslateMessage(MSG* pMsg) 
    {
    switch(pMsg->message)
    {
    case WM_KEYDOWN: 
         switch (pMsg->wParam)
     {
      case VK_RETURN:
     {
                                MFmain->scroll_Focus(this);
     return true;
     }
       }
    }
    return CBitmapDialog::PreTranslateMessage(pMsg);
    }void CMainFrame::scroll_Focus(CWnd *wnd)
    {
    /***********************************************/
    int m_Current_Focus_index=0;
    int m_Current_Focus_index_max=0;
    CWnd *listRect[1024];
    CWnd *pWndChild = wnd->GetWindow(GW_CHILD);
    while(pWndChild)
    {
    listRect[m_Current_Focus_index_max]=pWndChild;
    listRect[m_Current_Focus_index_max]->m_hWnd=pWndChild->GetSafeHwnd();
    m_Current_Focus_index_max++;
    pWndChild = pWndChild->GetNextWindow();

    }
    /***********************************************/
     for(int i=0;i<m_Current_Focus_index_max;i++)
     {
     if(listRect[i]==(CWnd*)GetFocus())
     {
     if(i==0)
    m_Current_Focus_index=m_Current_Focus_index_max;
     else
    m_Current_Focus_index=i;
     if(m_Current_Focus_index-1>=0 && m_Current_Focus_index-1<m_Current_Focus_index_max)
    listRect[m_Current_Focus_index-1]->SetFocus();
     break;
     }
     }
     
    }
      

  5.   

    我希望在CFormView中实现TAB,不是在CDialog中实现,该怎么做啊
      

  6.   

    得到回车的消息,发送tab的消息到当前有焦点的子窗口,可否?