MSDN > フォーラム ホーム > Visual C++ Language > Navigation between dialog boxes
質問する質問する
 

回答済みNavigation between dialog boxes

  • 2009年11月4日 6:33KEERV ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi

    I have a dialog displaying a few parameters and on pressing any key i need to move to the next dialog  say dialog-1. 

    Then I have the dialog box-1 which has few buttons. Each button should lead me to the respective custom dialogs.

    Then I need to return to the dialog box-1 from these custom dialogs when I press the back key.

    How do I go about implementing these navigations?

    Note- Am not using any preexisting dialog boxes.

回答

すべての返信

  • 2009年11月4日 10:06KEERV ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    Hey I figured out partially navigation implementations here..

    When You have to move from one dialog to the other say D1 to D2 on pressing any key,follow the steps:

    1)Create a class for the new dialog ie D2 with the base class as CDialog.
    2)Next add a member variable to the D1 class - of the type D2 class and give the access as private.(say m_dialog2)
    3)Next on the message WM_KEYDOWN add a function and add the following code:

    void CD1::OnButton()
    {
     // TODO: Add your message handler code here and/or call default
     
    if(m_dialog2.DoModal()==IDOK)
      UpdateData(FALSE);
     
     CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
    }

    For the above code only Enter and Space key are active.If i press any other key like the alphabets or numbers the navigation is not happening.. How do I go about this?
    How do i implement the back key navigation?
  • 2009年11月17日 22:34Tom SerfaceMVPユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    • 回答としてマークKEERV 2009年11月18日 5:51
    •