Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

First of all, add the anchor support for CFormView with the CExtWA template as it is described in the FAQ How to make CFormView to be look and act like CExtResizableDialog?After that, you can anchor your controls with an AddAnchor() method provided by CExtWA.

Please note that when the CFormView::OnInitialUpdate()method is called, the current size of the form view is already changed (i.e., it is not equal to the original size of the loaded dialog template resource). So, if you try to anchor your controls in the OnInitialUpdate()method, you may get unexpected results. That is why we recommend you set up anchors when the frame window, which is the parent of the form view, is created:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
      return -1;
 
    // create a view to occupy the client area of the frame
    m_pWndView = new CChildFormView;
    if (!m_pWndView->Create(
        NULL, 
        NULL, 
        AFX_WS_DEFAULT_VIEW, 
        CRect(0, 0, 0, 0), 
        this, 
        AFX_IDW_PANE_FIRST, 
        NULL
        )
      )
    {
      TRACE0("Failed to create view window\n");
      return -1;
    }
 
    ....
 
    if( !m_wndMenuBar.Create(
        NULL,
        this,
        ID_VIEW_MENUBAR
        )
      )
    {
      TRACE0("Failed to create menubar\n");
      return -1;    // failed to
create
    }
 
    m_pWndView->AddAnchor( IDC_YOUR_CONTROL, __RDA_LT, __RDA_RT );
 
...: