Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've started out from the wrong implementation: you shouldn't make a <code>CFormView</code> with a <code>CTabCtrl</code> and then stuff more <code>CFormView</code>s into it. This isn't going to work right. Instead, you should work with <code>CPropertySheet</code> and <code>CPropertyPage</code>, where focus handling has already been taken care of. You will still be able to access the <code>CTabCtrl</code> owned by the <code>CPropertySheet</code> by calling <code>GetTabControl()</code>, but MFC will take care of the problems you've encountered.</p> <p>Briefly: derive classes from <code>CPropertySheet</code> for each of the dialog windows you want to show (e.g., CConfigPage1, CConfigPage2). Create a Dialog resource in the Resource Editor for each of them, and do all of the other standard <code>CDialog</code> setup. </p> <p>Next, derive a class from <code>CPropertySheet</code> (e.g., CProps), and (optionally) handle WM_SIZE and TCN_SELCHANGE. </p> <p>Finally, derive a class from a CView descendent, like <code>CScrollView</code> (e.g., CViewMyAwesomeStuff). Then add member variables for the <code>CPropertySheet</code> and <code>CPropertyPage</code>s, and handle WM_CREATE where you Add() each page to the property sheet and then <code>Create(this,WS_CHILD|WS_VISIBLE)</code> the property sheet.</p> <p><strong>Bonus</strong>: You can forward the <code>CView::OnUpdate</code> to each child <code>CPropertyPage</code> by calling <code>GetPage()</code> in a loop and calling a function on each of them, or you can send a message to each of them (use a user-defined message, like <code>WM_APP+1</code>). They can discover their parent's <code>CDocument</code> by calling <code>GetParent()-&gt;GetParent()-&gt;GetDocument()</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload